Live data from Hacker News

Code Llama, a state-of-the-art large language model for coding

ai.meta.com

271–280 of 525 posts

Re: Code Llama, a state-of-the-art large language model for coding

#271
post #254

Earlier quoted context omitted.

FB is unlike the other BigTech(tm) since Zuck never sold out and has a controlling equity stake. Amazon, Google, and MS are all controlled by and beholden to institutional investors. FB can release these for no other reason than Zuck’s ego or desire to kill OpenAI. Same deal as him going off on a tangent with the Metaverse thing.

Wonder why Zuck particularly wants to kill OpenAI instead of increasing revenue with a new product offering.

Given that OpenAI finished training GPT4 a year ago, and no models today (including these) can beat it, I highly doubt anyone is capable of killing Open AI in the near future. I’m guessing by the time GPT5 is out, someone will finally catch up with GPT4.

Re: Code Llama, a state-of-the-art large language model for coding

#272

Earlier quoted context omitted.

Ollama supports it already: `ollama run codellama:7b-instruct` https://ollama.ai/blog/run-code-llama-locally More models uploaded as we speak: https://ollama.ai/library/codellama

while it supports it, so far I've only managed to get infinite streams of near nonsense from the ollama models (codellama:7b-q4_0 and codellama:latest) my questions were asking how to construct an indexam for postgres in c, how to write an r-tree in javascript, and how to write a binary tree in javascript.

> managed to get infinite streams of near nonsense

This should be fixed now! To update you'll have to run:

  ollama pull codellama:7b-instruct

Re: Code Llama, a state-of-the-art large language model for coding

#273

Earlier quoted context omitted.

while it supports it, so far I've only managed to get infinite streams of near nonsense from the ollama models (codellama:7b-q4_0 and codellama:latest) my questions were asking how to construct an indexam for postgres in c, how to write an r-tree in javascript, and how to write a binary tree in javascript.

Same, just tried it and it would give me infinite amount of blank lines

Sorry, this should be fixed now! To update you'll have to run:

  ollama pull codellama:7b-instruct

Re: Code Llama, a state-of-the-art large language model for coding

#274
post #7

Does anyone have a good explanation for Meta's strategy with AI? The only thing I've been able to think is they're trying to commoditize this new category before Microsoft and Google can lock it in, but where to from there? Is it just to block the others from a new revenue source, or do they have a longer game they're playing?

vessenes and rvz kind of sum the idea I think they're going for to me.

AI has no moat, but many players are in denial about this still. Microsoft and other might have tight enough control they can use a product dumping strategy to get people dependent upon their implementation such they can start charging, but that isn't a delusion Meta can have.

That max revenue license they used with the models seemed fairly clever to me. It will seed the environment with players that base their product on Meta tech in return for them being born with a poison pill preventing their use by big players (other than Meta) buying them. This is a long term play that may not really work but it creates the potential for big opportunities. And even if it doesn't work out, denying easy wins for their powerful competitors might be worth the price on its own.

Re: Code Llama, a state-of-the-art large language model for coding

#275

Works nearly out of the box with llama.cpp, which makes it easy to try locally: https://github.com/ggerganov/llama.cpp/issues/2766 Here's some output from q4_0 quantization of CodeLlama-7b-Python (first four lines are the prompt): # prints the first ten prime numbers def print_primes(): i = 2 num_printed = 0 # end of prompt while num_printed It will be interesting to see how the larger models perform, especially afte…

I'd fail an interview candidate that suggested adding 1 each time for subsequent prime testing

Re: Code Llama, a state-of-the-art large language model for coding

#276
post #216

Earlier quoted context omitted.

Well look for yourself: https://g.co/bard/share/e8d14854ccab The rm answer is now "hardcoded" (aka, manually entered by reviewers), the same with the prime or fibonnaci. This is why we both see the same code across different accounts (you can make the test if you are curious).

Okay, so the entire point of the comment is "A current model which does well used to be bad!" With all due respect, is that a valuable thing to say? Isn't it true of them all?

Mhh not just about the past, you can see such in current answers from Bard.

They are generally okayish, closer to "meh", than something outstanding.

Yes the shell script solution is better, it doesn't give rm -f anymore, but is still somewhat closer to a bad solution instead of just giving rm -i.

I'm just really happy and excited to see that a free-to-download and free-to-use model can beat a commercially-hosted offering.

This is what has brought the most amazing projects (e.g. Stable Diffusion)

Re: Code Llama, a state-of-the-art large language model for coding

#277
post #251

Earlier quoted context omitted.

Isn't ollama terminal only? For code, that wouldn't be good.

They have a server/client model. The binary comes with a basic terminal front-end but you can just create your own self-hosted GUI or editor integration against the API[1]: [1] https://github.com/jmorganca/ollama/blob/main/docs/api.md

Indeed! After pulling a model with "ollama pull codellama" you can access it via the REST API:

  curl -X POST http://localhost:11434/api/generate -d '{                        
    "model": "codellama",
    "prompt":"write a python script to add two numbers"
  }'

Re: Code Llama, a state-of-the-art large language model for coding

#278

Earlier quoted context omitted.

That model is trained on synthetically AI-generated code, not internal code. It suggests that synthetic training could be the future in increasing capability of smaller models (and perhaps bigger ones too). AI will train AI.

That is the basis for https://synthesis.ai/

I'm an amateur, but it seems to me that methods to synthesize will have to be distinct from methods of the generative model.

Re: Code Llama, a state-of-the-art large language model for coding

#279

>The Code Llama models provide stable generations with up to 100,000 tokens of context. Not a bad context window, but makes me wonder how embedded code models would pick that context when dealing with a codebase larger than 100K tokens. And this makes me further wonder if, when coding with such a tool (or at least a knowledge that they’re becoming more widely used and leaned on), are there some new considerations tha…

I built a VS code extension a while back that I still use that wraps GPT-4 and writes code directly in my editor.

The method I used to choose which files to feed GPT-4 was embeddings-based. I got an embedding for each file and then an embedding from the instruction + some simple processing to pick the files more likely to be relevant. It isn't perfect but good enough most of the time in medium-sized codebases (not very large ones).

The one thing I started doing because of how I implemented this is make files shorter and move stuff into different files. Having a 1k+ LOC file is prohibitive because it eats up all the context window (although with 100k context window maybe less so). I think it's a good idea to keep files short anyways.

There's other smarter things that can be done (like embed and pass individual functions/classes instead of entire files) so I have no doubt someone will build something smarter soon. You'll likely not have to change your coding patterns at all to make use of AI.

Re: Code Llama, a state-of-the-art large language model for coding

#280

Earlier quoted context omitted.

while it supports it, so far I've only managed to get infinite streams of near nonsense from the ollama models (codellama:7b-q4_0 and codellama:latest) my questions were asking how to construct an indexam for postgres in c, how to write an r-tree in javascript, and how to write a binary tree in javascript.

Similarly, I had it emit hundreds of blank lines before cancelling it.

Maybe it's outputting https://en.wikipedia.org/wiki/Whitespace_(programming_langua... :-)
Post reply on HN