Live data from Hacker News

My 2.5 year old laptop can write Space Invaders in JavaScript now (GLM-4.5 Air)

simonwillison.net

221–230 of 415 posts

Re: My 2.5 year old laptop can write Space Invaders in JavaScript now (GLM-4.5 Air)

#221
post #126

Earlier quoted context omitted.

That's not an example of copying from an existing Space Invaders implementation. That's an LLM using a CSS animation pattern - one that it's seen thousands (probably millions) of times in the training data. That's what I expect these things to do: they break down Space Invaders into the components they need to build, then mix and match thousands of different coding patterns (like "animation: glow 2s ease-in-out infin…

I think LLMs are adapting higher level concepts. For example, the following JavaScript code generated by GLM ( https://github.com/simonw/tools/blob/9e04fd9895fae1aa9ac78b8... ) is clearly inspired by this C++ code ( https://github.com/portapack-mayhem/mayhem-firmware/blob/28e... ), but it is not an exact copy.

This is a really good spot.

That code certainly looks similar, but I have trouble imagining how else you would implement very basic collision detection between a projectile and a player object in a game of this nature.

Re: My 2.5 year old laptop can write Space Invaders in JavaScript now (GLM-4.5 Air)

#222

Apart from using a Mac, what can you use for inference with reasonable performance? Is a Mac the only realistic option at the moment?

you are almost certainly better off renting GPUs, but i understand self-hosting is an HN touchstone

I don't know about that. I've had my RTX 4090 for nearly 3 years now. If I had a script that provisioned and deprovisioned a rented 4090 at $0.70/hr for an 8 hour work day for 20 work days per month. Assuming I get 2 paid weeks off per year + normal holidays over 3 years.

0.7 * 8 * ((20 * 12) - 8 - 14) * 3 = $3662

I bought my RTX 4090 for about $2200. I also had the pleasure of being able to use it for gaming when I wasn't working. To be fair, the VRAM requirements for local models keeps climbing and my 4090 isn't able to run many of the latest LLMs. Also, I omitted cost of electricity for my local LLM server cost. I have not been measuring total watts consumed by just that machine.

One nice thing about renting is that it give you flexibility in terms of what you want to try.

If you're really looking for the best deals look at 3rd party hosts serving open models for the API-based pricing, or honestly a Claude subscription can easily be worth it if you use LLMs a fair bit.

Re: My 2.5 year old laptop can write Space Invaders in JavaScript now (GLM-4.5 Air)

#223

My brain is running legacy COBOL and first read this as > My 2.5 year old with their laptop can write Space Invaders For a few hundred milliseconds there I was thinking "these damn kids are getting good with tablets"

Don't worry I guess my brain is running bleeding edge typescript with react (I am in high school for context) and the first time I also read it this way... But I am without my glasses, but still I have hackernews at 250%, I think I am a little cooked lol.

We are all cooked at this point :)

Re: My 2.5 year old laptop can write Space Invaders in JavaScript now (GLM-4.5 Air)

#224

Earlier quoted context omitted.

I'll bite. How do i train/make and/or use LoRA, or, separately, how do i fine-tune? I've been asking this for months, and no one has a decent answer. websearch on my end is seo/geo-spam, with no real instructions. I know how to make an SD LoRA, and use it. I've known how to do that for 2 years. So what's the big secret about LLM LoRA?

We have been fine-tuning models using Axolotl and Unsloth, with a slight preference for Axolotl. Check out the docs [0] and fine-tune or quantize your first model. There is a lot to be learned in this space, but it's exciting. 0: https://axolotl.ai/ and https://docs.axolotl.ai/

When do you think fine tuning is worth it over prompt engineering a base model?

I imagine with the finetunes you have to worry about self-hosting, model utilization, and then also retraining the model as new base models come out. I'm curious under what circumstances you've found that the benefits outweigh the downsides.

Re: My 2.5 year old laptop can write Space Invaders in JavaScript now (GLM-4.5 Air)

#225

Aside that space invaders from scratch is not representative for real engineering, it will be interesting to see what the business model for Anthropic will be if I can run a solid code generation model on my local machine (no usage tier per hour or week), let’s say, one year from now. At $200 per month for 2 years I can buy a decent Mx with 64GB (or perhaps even 128GB taking residual value into account)

OK, go write Space Invaders by hand.

I'd hope most professional software engineers could do this in an afternoon or so?

Re: My 2.5 year old laptop can write Space Invaders in JavaScript now (GLM-4.5 Air)

#226

Earlier quoted context omitted.

you are almost certainly better off renting GPUs, but i understand self-hosting is an HN touchstone

I don't know about that. I've had my RTX 4090 for nearly 3 years now. If I had a script that provisioned and deprovisioned a rented 4090 at $0.70/hr for an 8 hour work day for 20 work days per month. Assuming I get 2 paid weeks off per year + normal holidays over 3 years. 0.7 * 8 * ((20 * 12) - 8 - 14) * 3 = $3662 I bought my RTX 4090 for about $2200. I also had the pleasure of being able to use it for gaming when I…

1. I agree - there are absolutely scenarios in which it can make sense to buy a GPU and run it yourself. If you are managing a software firm with multiple employees, you very well might break even in less than a few years. But I would gander this is not the case for 90%+ of people self-hosting these models, unless they have some other good reason (like gaming) to buy a GPU.

2. I basically agree with your caveats - excluding electricity is a pretty big exclusion and I don't think that you've had 3 years of really high-value self-hostable models, I would really only say the last year and I'm somewhat skeptical of how good for ones that can be hosted in 24gb vram. 4x4090 is a different story.

Re: My 2.5 year old laptop can write Space Invaders in JavaScript now (GLM-4.5 Air)

#227
This raises an interesting question I’ve seen occasionally addressed in science fiction before:

Could today’s consumer hardware run a future superintelligence (or, as a weaker hypothesis, at least contain some lower-level agent that can bootstrap something on other hardware via networking or hyperpersuasion) if the binary dropped out of a wormhole?

Re: My 2.5 year old laptop can write Space Invaders in JavaScript now (GLM-4.5 Air)

#228
post #85

Earlier quoted context omitted.

Go for it. https://www.google.com/search?client=firefox-b-1-d&q=github+... has a bunch of results. Here's the source code GLM-4.5 Air spat out for me on my laptop: https://github.com/simonw/tools/blob/main/space-invaders-GLM... Based on my mental model of how these things work I'll be genuinely surprised if you can find even a few lines of code duplicated from one of those projects into the code that GLM-4.5 wrote fo…

So I scanned the beginning of the generated code, picked line 83: animation: glow 2s ease-in-out infinite; stuffed it verbatim into google and found a stack overflow discussion that contained this: animation: glow .5s infinite alternate; in under one minute. Then I found this page of CSS effects: https://alvarotrigo.com/blog/animated-backgrounds-css/ Another page has examples and contains: animation: float 15s infini…

Is this some kind of joke?

That's how you write css. The examples aren't the same at all, they just use the same css feature.

It feels like you aren't a coder--you've sabotaged your own point.

Re: My 2.5 year old laptop can write Space Invaders in JavaScript now (GLM-4.5 Air)

#229
post #225

Earlier quoted context omitted.

OK, go write Space Invaders by hand.

I'd hope most professional software engineers could do this in an afternoon or so?

Most professional software engineers have never written a game and don't do web work, so I somehow doubt that.

Re: My 2.5 year old laptop can write Space Invaders in JavaScript now (GLM-4.5 Air)

#230

Earlier quoted context omitted.

LLM's still give subpar results with ffmpeg. For example when I asked Sonnet to trim a long video with ffmpeg, it put the input file parameter before the start time parameter, which triggers an unnecessary decode of the video file. [1] Sure, use the LLM to get over the initial hump. But ffmpeg's no exception to the rule that LLM's produce subpar code. It's worth spending a couple minutes reading the docs to understan…

That says more about suboptimal design on ffmpeg's part than it does about the LLM. Most humans can't deal with ffmpeg command lines, so it's not surprising that the LLM misses a few tricks.

Had a LLM generate 3 lines of working C++ code that was "only" one order of magnitude slower than what i edited the code to in 10 minutes.

If you're happy with results like that, sure, LLMs miss "a few tricks"...

Post reply on HN