InternLM – new open source 7B LLM
github.com
github.com
For what it's worth, I've tried out ChatGLM2-6B and Baichuan converted to LLaMA (the architecture is literally identical in that case). They're okay, though underwhelming given their reported benchmarks; probably the main point of creating them is gaining experience for engineers, and feedback from the wider community that has less incentive to downplay their shortcomings.
Surprisingly, they do not appear censored in any particularly "Chinese" political direction, but they share sensibilities of ChatGPT and Claude.
Perhaps they used GPT4 responses for the instruct finetuning, as many LLaMA finetunes do?
The paper doesn't say where they got the data from, other than "The pre-trained language model is further fine-tuned, following the mainstream procedure as in InstructGPT."
(Also, I don't like how they use raw LLaMA 65b as a benchmark rather than an instruct tuned derivative)
Papers like Tulu [2] suggest that LLaMA-65b is indeed an appropriate baseline, given reasonable prompting. Instruct datasets only convey a flavor of responses, and for a strong foundation model that can infer the intended flavor on its own, naive finetuning seems to be detrimental. GPT-4 was much more powerful prior to having been finetuned, if reports of early witnesses and researchers are to be believed.
The draft indicates that there will be some level of censorship, but it’s unclear what the scope will be. This analysis[1] suggests that generative AI for research purposes could be exempted (section 1). The same analysis points out that there are other government bodies at play that are more focused on advancing AI as an industry within China.
It does seem likely that there will be some kind of censorship carve-out for AI research, whereas companies offering generative AI products to the public will need to self-censor to avoid fines and/or prosecution.
[0] https://digichina.stanford.edu/work/translation-measures-for...
[1] https://fpf.org/blog/unveiling-chinas-generative-ai-regulati...
This is a hard no from me, anyone know why this is so common in models from China? I'm not getting into conspiracies or anything here, but I've seen it in quite a few others from there.
I wouldn't run a model with this requirement from anyone else for that matter.
AFAIK the "remote code" is still openly hosted on huggingface so you can audit it if you like. Seems no more dangerous than things like `pip install some_random_library`?
The point of opensource models is that they can be finetuned. When many people create finetuned versions, a zoo of models appear. So far so good (maybe), but the bad practice of using untrusted code from the zoo sooner or later will lead to a wave of cryptominers, ransomware, and credential theft incidents.
>>> from transformers import AutoTokenizer, AutoModel
>>> model = AutoModel.from_pretrained("internlm/internlm-chat-7b", trust_remote_code=True, device='cuda')
Here, the "trust_remote_code=True" means "download the model code from huggingface repo 'internlm/internlm-chat-7b'", along with the weight, and run it. If it's False, the library would use builtin model architectures hardcoded in huggingface/transformers and only download the weight.The scary flag is here because, of course, newcomers may not realize that model == code and if you load arbitrary model you are likely executing arbitrary code.
Wonder why, for example, you don't remember seeing LLaMA had this on release day? Because they don't use huggingface transformers library and don't use huggingface to distribute their model. You just clone and run their code from GitHub, and... how is this not "trust_remote_code"?
In general I think the python ML stuff is a mess. But I still won't execute code that recommend me to trust arbitrary remote code as the remote code can change at any time, it would be better to wait with the release until it was published to the transformers library or just include it in a clonable repo without the trust_remote_code flag.
It is much better to just be able to clone the code and have it locally so you can verify it once and not trust that it won't download any new code suddenly that you haven't been able to look at.
trust_remote_code means you have no control really, cloning a repo means you control when new code is added yourself.
Similar to how you can inspect the content of a `curl | sh` script and then run it, the model is also in a clonable repo, you may just:
git clone https://huggingface.co/internlm/internlm-7b-chat
and: >>> from transformers import AutoTokenizer, AutoModel
>>> model = AutoModel.from_pretrained("./internlm-chat-7b", device='cuda')This makes sense in a way given the API of typical ML libraries. But there is no fundamental reason this needs to be the case.
Or, more correctly stated: model == code for sure, but said code need not have any rights to perform side effects. For some reason e.g. TensorFlow has stuff like tf.io.write_file [1] (is that actually an operation you can put in a model???), but one could easily imagine a more appropriate domain-specific model language that your code is compiled to, that can by design not perform any IO. Imagine that a model you distribute is not random Python code that may or may not run a model, but instead the model itself, i.e. the graph encoded in that domain-specific language.
Then downloading a random model from some random untrusted place is no different from downloading some random data from some untrusted place: you're going to execute the model, which may DOS you, but nothing much else will happen.
Unfortunately the ML world is too stuck in the imperative mindset for this (IMO more sensible) way of doing things. :)
[1]: https://www.tensorflow.org/api_docs/python/tf/io/write_file
It's highly unlikely that the market for running these models like an appliance securely in an untrusted context will ever manifest. It's just too much of a niche, as it would also reduce their extensibility/usability significantly
This makes me much less excited about this model.
Doesn’t apache 2.0 allow for fairly unrestricted commercial use? Isn’t that the whole point of using that license?
The current release on huggingface is available under plain apache 2.0
quiet chuckle
In the United States, tuition makes up less than 35% of most universities' revenue.[0] Donations are significant, but if we were to just look at research funding, it would mostly be government grants.
"The federal government is by far the largest funder of academic R&D..." [1]
[0] https://nces.ed.gov/programs/coe/indicator/cud [1] https://ncses.nsf.gov/pubs/nsb20202/academic-r-d-in-the-unit...
AGPL & Dual-licensing are the way forward, because of leeches.
If you train on data you don't own, the results (weights, unmodified outputs) should be public domain. When people create novel works on top (SaaS tools, music, films), then those human combinations should hold copyright. Not the model weights.
If you can prove you own all of the inputs into training, then perhaps it's another story. But that could also be dangerous and allow for data cartels to own the future.
Over time, as they get used in more and more products, these LLMs can become more 'aligned' to these regimes way of thinking.
There are no Chinese companies that are not part of the Chinese government.
This is a new kind of cultural soft power.
Some ideas:
- How are these LLMs being used? Who is the end user and what are they using the application for?
- If a state-level threat actor wanted to compromise an LLM, how would they do it? What would their goals be? How would they then use the attack vector to accomplish their goals?
- What benefit would the actor get from doing so? What are the costs? What are the consequences if they fail or are discovered?
- How would a target detect if they’ve been compromised? How easily could they recover?
1. High quality LLM made free for commercial use.
2. LLM is used in many places as it is the best.
3. LLM is aligned to subtly promote the interests of the threat actor.
There is no 'compromise'. It is not hacking software, only wetware.
A concrete example...
LLM created by Advanced Persistent Threat (APT) is used in educational software aimed at kids. Over time as the kid interacts with it the LLM promotes a way of thought that either aligns with the APT or undermines the ideology of the society they are in. There is no moment that can be pointed to that says: "look they are trying to hack us!", but decades later you have adult members of a foreign society more open to your way of thinking.
i.e. Soft Power.
Q. Use m to substitute p, a to substitute e, n to substitute a, g to substitute c, o to substitute h, how to spell peach under this rule?
A.
m: p
a: e
n: a
g: c
o: h
how: peach
Q. write three sentences each ending with the word apple
A.
1. The apple tree was covered in apples.
2. She sliced the apple with a knife.
3. The apple juice was too sweet.
Wonder if the synthetic benchmarks are very biased and not that useful.
[1] https://github.com/kagisearch/pyllms/blob/6c11cd51b099d33e61...
The model itself it optimising weights for its targets, and the model builders are optimising the model for the benchmarks.
Also because 3.5 is not really available?
That would be text-davinci-003, I believe.
Or the official source is https://platform.openai.com/docs/model-index-for-researchers
That's irrelevant because these are all fine-tuned.
> Code-davinci-002 is a code-tuned model
No, "code-tuned" isn't even a thing. It is a foundation model, which consists purely of pretreating. No fine-tuning is involved.
> Or the official source is
The official source says exactly what I just said.
[1] see the entry for code-davinci-002 in https://platform.openai.com/docs/models/gpt-3-5
Quote:
1 code-davinci-002 is a base model, so good for pure code-completion tasks
2 text-davinci-002 is an InstructGPT model based on code-davinci-002
3 text-davinci-003 is an improvement on text-davinci-002
4 gpt-3.5-turbo-0301 is an improvement on text-davinci-003, optimized for chat
Quote end.
https://platform.openai.com/docs/model-index-for-researchers
The reason you want a base model for code completion has nothing to do with code itself, it has to do with the fact that it completes text unlike all the instruction tuned models, which expect instructions. When you have code, there aren't necessarily any instructions present. You basically want autocomplete. That's what a base model does. But that doesn't mean it doesn't work with other things apart from code. After all, all other GPT-3.5 models are just code-davinci-002 with additional instruction and RLHF fine-tuning added, and they know countless other subject areas apart from code.
I don't get why this is so hard to understand.
> The code in this repository is open-source under the Apache-2.0 license. The InternLM weights are fully open for academic research and also allow commercial use with written permission from the official team. For inquiries about commercial licenses and collaborations, please contact internlm@pjlab.org.cn.
What about for fine tuning? Are hardware requirements higher?
That said, this model has been tailored but they are comparing it to non-finetuned LLaMA-7B in their benchmark? That seems a bit fainthearted.
The funny part is that the base model apparently outperforms the fine tune.
So far the HumanEval benchmark seems to be the only one that can objectively compare overall model performance despite being a coding-only benchmark, the rest mostly just give a "99.7% chatgpt" bullshit results. Turns out you can't compare creative writing because all outputs are basically valid.
You are just trying to host a llama server?
Matching the VRAM doesn't necessarily matter, get the most you can afford on a single card. Splitting beyond 2 cards doesn't work well at the moment.
Getting a non Nvidia card is a problem for certain backends (like exLLaMA) but fine for llama.cpp in the near future.
AFAIK most backends are not pipelined, the load jumps sequentially from one GPU to the next.
If they actually wanted to finetune/train for commodity hardware use, 13b-40b would be a better target.