WorldTUI: I trained a 360M model to pretend to be a terminal

Posted by alphax314 8 hours ago

Counter252Comment79OpenOriginal

Comments

Comment by nico 4 hours ago

Very very cool! Impressed that it can be done with only fine tuning

On a very similar theme, I recently built a “lossy git”, which stores your code by training a neural network, then it generates the code back to you on checkout

* web demo: https://nicobrenner.github.io/lossy-git/demo.html

* cli version: https://nicobrenner.github.io/lossy-git/

The web demo runs entirely on the browser, both the version control and the neural network training/inference. You can commit and checkout both images or code - you can also paste/“upload” your own images, no server requests (everything clears from the page on reload)

Comment by InsideOutSanta 58 minutes ago

That's hilarious. I bet if I committed my code into that repo, it would check out with fewer bugs.

Comment by simedw 3 hours ago

That's very cool project. I read this blog post a few days ago about one way to look at memory encoding in models https://alexwang.ai/posts/associative-memory/ that you might find relevant

Comment by embedding-shape 27 minutes ago

> Commit code, it trains. Checkout, it reconstructs from memory.

I see a "Commit" button, but I don't see any checkout, I guess that is what happens automatically? Although that panel says "Reconstruction", not "Checkout"... You might want to do a pass after the AI created the initial version, and make it "humanly consistent" or similar, as right now it seems a bit incoherent.

> Run the JS code before and after a commit

How am I suppose to "run the JS code", manually writing it in my local JS console? Or is this just "Click the green button in the UI" but expressed in the way only a LLM would write it?

Comment by ChanderG 5 minutes ago

I was searching the blog but couldn't find details on the fine-tuning process. What was the hardware and software used? Any learnings there?

Comment by andai 5 hours ago

>I used Qwen2.5-Coder-0.5B as the starting point. I needed a small model to get close to realtime performance. Being a coding model, it had also already seen plenty of CLI usage.

Interesting. I wanted to ask, how that model compares with the fine-tuned version, but I just saw the author provided benchmarks. Interesting that fine-tuning improved the memory so significantly, wouldn't have expected that.

Though, on second thought, I had an experience where I was able to, as a human, fine-tune my memory beyond what I previously thought was possible!

Reminds me of one of my favorite jokes.

Excuse me, can you tell me how to get to Carnegie Hall?

—Practice, man... Practice...

Comment by treetalker 4 hours ago

> … I had an experience where I was able to, as a human, fine-tune my memory beyond what I previously thought was possible!

Please elaborate.

Comment by absoluteunit1 1 hour ago

Yes please. I'm curious

Comment by simedw 4 hours ago

I haven’t run extensive tests yet, but larger models also get better at memory.

Comment by suhdonghwi 35 minutes ago

It's very tricky to make it hallucinate fake commands. I've been trying `dogsay` (instead of `cowsay`) but no luck. Any tips?

Comment by ponyous 2 hours ago

One of the first very cool demos I've seen of ChatGPT was in a post where the author prompted AI "pretend to be a terminal". Then went on to execute commands like `cd .fbi`, `ls files`, `cat files/confidential.txt`. Very fun demo. Looking forward to exploring similar idea with this terminal

Comment by OtherShrezzing 2 hours ago

I think this project is a very good way to explore the question:

>What's the difference between a model that predicts intelligent output, and intelligence itself?

It doesn't directly attack the question, but gives a neatly constrained thought experiment which you can see running.

Comment by luipugs 2 hours ago

Isn't that just the turing test? I suppose you have you answer now that models can easily pass it.

Comment by metchio 2 hours ago

i agree absolutely with you. and this kind of reinforce my idea that, like this predicted terminal could not be considered a real terminal, predicted intelligence could not be considered real intelligence

Comment by 1 hour ago

Comment by thepasch 1 hour ago

Like with many things, it depends entirely on how you define "real terminal"; that is, what a "real terminal" must do before it satisfies your definition. If it's "takes input and deterministically executes its instructions, producing output along with side effects," a well-trained model with argmax sampling could well meet the bar. if given the appropriate external interfaces.

Comment by bubulux 1 hour ago

Thats an very interesting way to think about this, never thought to invert it that way.

I allways found it interesting to look at this issue in the way the imitation game was modeled. For me I concluded, that as long as we can replicate the intution we associate with intelligence, there is not much room left to debate about "real intelligence".

The chinese room experiment I find in that sense a valuable extension, cuz the turing model more or less is a very conversational "voided of action" kind of test. The room model adds the act of translating without having the knowledge of translation.

But your take invalidates my stances here clearly. There is a possible scenario, in which we can replicate the intuition for operating a real terminal but still keeping the act of the terminal itself a "voided" sort of action by itself, cuz well, its not a real terminal, reading real files and so on...

Thank you for this, I will have to chew on that :)

Comment by wy1981 24 minutes ago

Questions for folks familiar with fine-tuning: what are the best resources to learn fine tuning?

Comment by amelius 1 hour ago

The next step is training a model to pretend to be the internet.

(You could run lynx in that terminal to train/test it without images)

Comment by randfur 23 minutes ago

I remember a couple of these from a few years ago. Long gone now of course but a fun demo of AI hallucinating the internet endlessly, generated pages from URLs that had more URLs in them to navigate to.

Comment by sandGorgon 1 hour ago

this is quite similar to amazon-science Cyber-Zero ?

https://github.com/amazon-science/Cyber-Zero

the paper is quite interesting - https://arxiv.org/html/2508.00910v2

Comment by 2 hours ago

Comment by oilkillsbirds 5 hours ago

Very cool. Fun project. I feel like there’s a wide field to be explored once you understand fine tuning good existing models

Comment by amelius 1 hour ago

> I had a blast building this. Is it useful? Not really.

Maybe instead of simulating a terminal you could use it to predict what you'd type next?

So simulate _you_, not the terminal.

Comment by __mp 5 hours ago

It would be interesting to expose this on the internet. I wonder what the scrapers etc… would do with it.

Comment by air7 1 hour ago

I remember doing something like this in the ancient era of GPT 3 or 4. I just told it that it was a terminal responding to commands and it was surprisingly consistent.

Comment by obilgic 5 hours ago

There was a whole fake gui OS with similar concept right

Comment by andai 5 hours ago

VibeOS - Fully Hallucinated Operating System

https://www.youtube.com/watch?v=z3pV6FHvcgM

Comment by AlecSchueler 1 hour ago

Was the video also hallucinated? Doesn't seem to exist.

Edit: Maybe this was it—https://youtube.com/watch?v=7NfyZhV1dKM

Comment by tsukurimashou 1 hour ago

> This video isn't available anymore

Comment by prodigycorp 5 hours ago

athropic had an experiment that did exactly this. we need more experimentation in this space.

Comment by ohadpr 3 hours ago

Very cool to do this as a Terminal!

I did it for web apps last year, basically a web server that feeds all requests into an LLM.

https://www.ohad.com/blog/voidware/

Comment by Lerc 4 hours ago

I wonder how much a small model could do if it had a tool calling API for a filesystem, an embedded busybox, and a single output token for 'emit what busybox would do here'. Then presumably the model parameters could learn everything that diverges from what busybox can handle.

Comment by alex7o 3 hours ago

I think the toolcalling should be system prompts then the agent is the userspace

Comment by Lerc 3 hours ago

That's a whole other kettle of trout. Maybe still worth a go mind.

On thin that would be useful is an entirely new permission system for files to allow for users and agents acting for users.

Comment by alex815 47 minutes ago

[flagged]

Comment by psandor 5 hours ago

Reminds me of this project from Microsoft. A Quake II “simulation” model where the whole application was just a model.

https://www.microsoft.com/en-us/research/articles/whamm-real...

Comment by soulofmischief 5 hours ago

These are called world models, which is why the project is called WorldTUI. For another example, take a look at Google's recent Genie models. https://deepmind.google/blog/genie-2-a-large-scale-foundatio...

Comment by 4ggr0 1 hour ago

wonder if the PHP on this hallucinated terminal is patched already.

Comment by claykkari 33 minutes ago

Perhaps it has a hallucinated PHP that never had those bugs.

Comment by 4ggr0 23 minutes ago

or it's kind of a schroedinger's PHP. as long as you don't debug it, it simultaneously includes every security hole ever, and none of them.

Comment by yjftsjthsd-h 5 hours ago

Wait, how did it `sleep 3`? I thought LLMs didn't have a concept of time

Comment by peder 5 hours ago

It’s still rendering frames constantly, no? So it just figures the next X frames are all doing nothing?

Comment by simedw 4 hours ago

Normal only keypresses invoke the next ”frame”. There is a sleep token that the runner could use to indicate that time is moving.

Comment by sprobertson 5 hours ago

from the post:

Time is an input too. If nothing is pressed, the model gets a WAIT token with a duration instead of a key, which is how snake keeps moving on its own.

Comment by yjftsjthsd-h 5 hours ago

That seems as likely as anything, but that just moves the problem to counting, doesn't it? The model gets the duration, but I was under the impression LLMs struggled with the arithmetic that would make that useful.

Comment by skohan 4 hours ago

Idk about Qwen 2.5 Coder that this is based on, but modern models don't struggle with arithmetic. I see Qwen 3.8 do long-hand math in thinking traces (ie. it outputs 17+35+12=64 in the thinking trace) so I would imagine this is something they train into the model specifically. Sometimes it creates and runs a simple python script to check its work.

Comment by zahlman 2 hours ago

It's still strange to me that an ability to perform arithmetic (and not just memorize a giant table of results) could emerge from training on language.

Comment by skohan 2 hours ago

In principle a large enough neural network can provably approximate any continuous function. Since arithmetic can be represented with a concrete grammar, it's not surprising to me that an LLM could contain an abstract representation if trained correctly.

Comment by thorum 5 hours ago

I regretfully suspect this actually is the future of UI. You just need smart local models running fast enough to keep the framerate high, but that’s inevitable in the long term, isn’t it?

Comment by skohan 5 hours ago

We had decades to work on making software more performant, but instead most users' space-age 2nm chips spend most of their time running Javascript because it was faster to make software that way.

Comment by winrid 4 hours ago

even my ten year old laptop browses the web fine ^_^

If I had to complain about any site/app it'd be datadog... each tab uses like 1gb in firefox.

Comment by skohan 2 hours ago

I think it's hard to understand how much better your experience could be if all your software was 10x faster and using 0.1x the resources, since you can't test both experiences side by side

It's like riding a bike with a tiny bit of resistance in the bearings. You will get used to it, and will probably feel like your bike is fine. But if you replace the hub and remove that friction, you will wonder how you ever tolerated riding a bike that way.

Comment by mrweasel 1 hour ago

Even assuming that the hardware and models catch up, wouldn't there be an issue with the model not being completely deterministic? You don't really want any sort of randomness in your terminal commands.

Comment by claykkari 44 minutes ago

> You don't really want any sort of randomness in your terminal commands.

Maybe I do, if by "randomness" you also mean the ability to handle unexpected usecases. Imagine running something like:

$ ps "which processes are slowing my PC down??"

Comment by 50 minutes ago

Comment by gr_norm 5 hours ago

Why would you do that instead of having the model do the task you're using the UI for? It could generate UI widgets on-the-fly as needed to take richer inputs.

Comment by skohan 4 hours ago

It might be fine for one-off applications, but it's incredibly inefficient for something that has to be done over and over.

Why would you use a GPU and gigabytes of VRAM running a non-deterministic process for something a program can do on the CPU in milliseconds with kilobytes of memory?

Comment by hnlmorg 4 hours ago

Probably for the same reasons most of our desktop applications have become slow Chromium instances consuming multiple GBs of RAM, each:

It’s cheaper to hire developers, and quicker to ship software. The user experience be damned.

Comment by skohan 4 hours ago

The logic here is a bit different. Consumer software is slow because it's the user paying for the compute to run those bloated Electron apps. Unless we're all running local inference in the future, it would be the vendor paying for the compute to run the AI-based UI.

Of course they would pass that along to the consumer, but nobody is going to pay token-based pricing for something that used to be free and ad-supported, or a cheap monthly subscription.

Comment by hnlmorg 2 hours ago

This demo is already using a local model. Which is why I made the Electron comparison.

Comment by antonvs 4 hours ago

I don't really disagree, but... why do we use Javascript for so many UIs? Badly designed web pages with ads can easily use gigabytes of RAM.

Edit: oh, I saw you wrote a related comment after I posted this. So you already know that direct LLMs for UIs are all but inevitable...

Comment by latentsea 3 hours ago

What if we're really just living in a world model? How big of a GPU is required to run the universe I wonder?

Comment by rvz 2 hours ago

This makes absolutely no sense what so ever.

There's a good reason why the UI for Excel, Photoshop and Word has hardly changed and remains consistent for years and that has worked for billions of people.

Many HN readers have forgotten the Windows 8 UI disaster already.

Comment by prodigycorp 5 hours ago

Wow! This this reminds me of when we tried doing this with gpt 3 and.. it worked!

The tmux thing had me confused for a moment until i realized it was emulating tmux. Super fun. Is the model window width aware?

Comment by simedw 23 minutes ago

The first part of the context is the window width:

``` BOS SCREEN_START 32 96 ```

I trained it on three different resolutions, but it should kind of work with in between ones too.

Comment by serje1480 4 hours ago

Comment by billypilgrim 1 hour ago

Thank you for linking that. I distinctly remember this moment as an important point in time, played around with emulating a terminal for hours, couldn’t believe how realistic it was, it even remembered when I changed a file earlier etc. Another point was when people on twitter with early access were like “oh my god it can write code too! I asked it to design a website and it just works!”, programming wasn’t even what LLMs were about, and now it’s one of the main use cases. Another revelation was when it could kinda play chess. A single model that can one shot a huge array of different problems, still mind blown how well all of this works to this day.

Comment by sudo_cowsay 1 hour ago

Verry Verrry Cool and neat!

Comment by donperignon 4 hours ago

I tried it and is not working remotely as close as the demo gif. It keeps telling me that "test1" folder that I want to create already exists (not true), then letting me do "mkdier test2" (sic) but then the folder is not there when ls. I mean all its expected, this has no state, follow no rules and is making up things from the current context, but is not as "magical" as I thought when watching the demo.

Comment by teiferer 1 hour ago

Haha nice!

I'm a noob in this, could you enlighten me: what role does the base model play which you started with?

Comment by simedw 21 minutes ago

Thank you.

The base model already have a good grasp of language, so that man pages look like coherent sentences. It also knows python and similar language well, which means that things like 1+5 or print(["hi" for _ in range(5)]) work.

I did try to train from scratch, but it was much weaker (also added a lot of aux losses).

Comment by 4 hours ago

Comment by 5 hours ago

Comment by gobdovan 2 hours ago

Comment by joka88xj 1 hour ago

[dead]

Comment by wkilbride 3 hours ago

[flagged]

Comment by luckystarr 4 hours ago

[dead]

Comment by simedw 5 hours ago

[flagged]

Comment by happybox2016 2 hours ago

[flagged]

Comment by htoz1 5 hours ago

Where is the point of this project if i have terminal ?

Comment by YmFzZTY0ZGFkZHk 5 hours ago

Sometimes it's just fun to do something absurd because you can. This is one of the reasons software is exciting.

Comment by mehmetoguzderin 5 hours ago

Terminal world models have many applications, but empirical observation of successful pretraining or fine-tuning can be significant for encapsulating from rather expensive Bash traces, such as ones obtained from systems with scarce accelerators, etc.

Comment by good-idea 5 hours ago

because curiosity is the most fun of virtues!

Comment by aghuang 4 hours ago

Was thinking the same thing. I just run my usual terminal and get to work.

Comment by dotancohen 5 hours ago

Because it was there

Comment by antonvs 4 hours ago

This will allow you to delete your terminal app and, eventually, all other binaries in your system!

Comment by wartywhoa23 3 hours ago

[flagged]

Comment by gitowiec 3 hours ago

BUG: Running in Firefox makes every keypress a slow motion show. It decodes every keypress instead of sending a command with Enter key

Comment by odo1242 3 hours ago

No, the model is simulating the entire TUI, not just terminal commands. It also actually is that slow (because it's generating a diff for the entire screen each time you make a keypress).

Comment by simedw 20 minutes ago

Exactly, I wonder if I'm not hitting the right WebGPU path for Firefox?