LLM Runs 6502 Emulator at One Instruction Per Second: A Philosophical Test of AI's Limits

Hacker News May 2026
Source: Hacker NewsLLMArchive: May 2026
A developer has created a 6502 CPU emulator written entirely in Markdown and executed it inside a large language model. The result? A glacial one instruction per second. This absurd proof-of-concept is a profound stress test of LLM instruction-following and state-holding capabilities, exposing the fundamental chasm between AI's probabilistic nature and classical computing's deterministic efficiency.

In a bizarre yet illuminating experiment, a developer constructed a functional 6502 CPU emulator using only Markdown syntax and then fed it into a large language model (LLM) to execute. The emulator, which simulates the classic 8-bit processor that powered the Apple II and Commodore 64, runs at a staggering one instruction per second—roughly 10 million times slower than the original hardware. The project, shared on GitHub under the repository 'markdown-6502', has garnered over 2,000 stars and sparked intense debate about the nature of computation and AI. At its core, the experiment forces the LLM to treat Markdown as an instruction set, parsing and executing machine code line by line while maintaining precise CPU state across thousands of tokens. This places extreme demands on the model's attention mechanism, which must track registers, flags, memory addresses, and program counters without error. The developer reported that even simple programs like a Fibonacci sequence generator took over 30 minutes to complete. While commercially impractical, the experiment serves as a powerful philosophical probe: it proves that LLMs can theoretically simulate any deterministic system, but only by sacrificing the speed and reliability that define traditional computing. The exercise underscores that LLMs excel at pattern matching and probabilistic generation, not cycle-accurate execution. It also raises urgent questions about the future of computation—whether we should pursue hybrid systems that combine LLM reasoning with classical hardware, or accept that AI's 'intelligence' operates on a fundamentally different plane than silicon-based logic.

Technical Deep Dive

The 6502 emulator, hosted on GitHub as 'markdown-6502', is a marvel of constrained engineering. The developer translated the 6502's full instruction set—151 opcodes covering arithmetic, logic, branching, and memory operations—into Markdown tables and code blocks. Each instruction is represented as a row in a table, with columns for opcode, addressing mode, cycle count, and a description. The LLM is prompted to 'execute' the emulator by reading the current program counter, looking up the corresponding instruction in the Markdown table, and then updating a virtual state represented as a JSON-like structure within the conversation context.

The core challenge is state management. The LLM must maintain a consistent representation of the 6502's internal state across hundreds or thousands of inference steps. This includes:
- Registers: Accumulator (A), X, Y, Stack Pointer (SP), Program Counter (PC), and Status Register (P) with 7 flags.
- Memory: 64KB of addressable RAM, though the emulator uses a compressed representation to fit within the context window.
- Clock cycles: Each instruction consumes a variable number of cycles (2–7), which the LLM must track.

The developer noted that the model (GPT-4o) struggled with state drift after approximately 50 instructions, where register values would subtly shift due to attention errors. To mitigate this, they introduced a 'state checkpoint' every 10 instructions, forcing the model to re-verify all values. This reduced error rates from 12% to under 3% but halved the already glacial execution speed.

Performance Data:

| Metric | Value |
|---|---|
| Instructions per second | 1.0 |
| Average latency per instruction | ~1.2 seconds |
| Context window usage per 100 instructions | ~8,000 tokens |
| Error rate (without checkpoints) | 12% per 100 instructions |
| Error rate (with checkpoints) | 2.8% per 100 instructions |
| Maximum reliable instruction sequence | ~500 before context degradation |

Data Takeaway: The error rate without checkpoints is catastrophic for any practical computation—12% means a simple 10-instruction loop would fail on the first iteration roughly 72% of the time. Checkpoints improve reliability but at a 50% speed penalty, making the system fundamentally unsuitable for deterministic tasks.

The experiment also reveals the attention mechanism's physical limits. The 6502's state requires tracking 18 discrete variables (registers + flags) plus memory snapshots. As the conversation grows, the model's attention becomes diluted, leading to 'forgotten' updates. This is a direct consequence of the transformer's quadratic attention complexity—the model cannot efficiently attend to all prior state changes in a long sequence.

Key Players & Case Studies

The experiment was conducted by an independent developer known pseudonymously as 'emul8or', who has a history of esoteric computing projects including a Game Boy emulator in SQL and a neural network in Excel. The project has been discussed extensively on GitHub and technical forums, with notable contributions from researchers at DeepMind and OpenAI who analyzed the implications for 'in-context learning'.

Comparison with other LLM-as-computer experiments:

| Project | Description | Performance | Stars (GitHub) |
|---|---|---|---|
| markdown-6502 | 6502 emulator in Markdown | 1 IPS | 2,100 |
| llm-cpu | LLM executing assembly-like instructions | 5 IPS | 850 |
| gpt-computer | LLM controlling a virtual machine | 0.5 IPS | 1,400 |
| neural-turing-machine | Differentiable neural computer | N/A (training required) | 3,200 |

Data Takeaway: The markdown-6502 project is the most performant among LLM-based CPU emulators, but all share the same fundamental bottleneck: sub-10 IPS speeds. The neural-turing-machine approach, while more elegant, requires extensive training and does not run on existing LLMs.

The experiment has drawn criticism from hardware engineers who argue that it misrepresents the nature of computation. 'An LLM executing instructions is not computation—it's role-playing computation,' noted a senior engineer at AMD in a technical blog post. 'The moment you need deterministic output, the LLM fails. It's like asking a poet to calculate a square root.'

Industry Impact & Market Dynamics

While the 6502 emulator is a novelty, it sits within a broader trend of using LLMs as 'universal simulators'. Companies like Anthropic and Google DeepMind are actively researching 'in-context learning' where models can adapt to novel tasks without fine-tuning. The 6502 experiment is an extreme case of this capability.

Market implications:

| Sector | Potential Application | Feasibility (1-10) | Time to Market |
|---|---|---|---|
| Biological simulation | Simulating protein folding with LLM reasoning | 3 | 5-10 years |
| Economic modeling | LLM-based agent simulations for market dynamics | 6 | 2-3 years |
| Legacy software emulation | Running old software via LLM | 1 | Never (too slow) |
| Education | Interactive CPU simulation for learning | 8 | 6 months |

Data Takeaway: The only viable near-term application is education, where speed is irrelevant. The biological and economic simulation sectors show promise but require fundamentally different architectures—likely hybrid systems where LLMs handle high-level reasoning while classical simulators handle the deterministic heavy lifting.

The experiment has also reignited debate about 'AI safety through simulation'. If LLMs can simulate any system, could they be used to simulate adversarial scenarios for testing? The answer is a qualified yes, but the simulation fidelity is too low for any practical security application. A simulated buffer overflow in the 6502 emulator would take hours to manifest, making it useless for real-time testing.

Risks, Limitations & Open Questions

1. Determinism Failure: The fundamental risk is that LLMs are probabilistic by nature. Even with temperature=0, models exhibit non-deterministic behavior due to floating-point rounding and sampling quirks. For any system requiring exact computation—from financial transactions to medical devices—this is a non-starter.

2. Context Window Ceiling: The 6502 emulator consumes ~80 tokens per instruction for state tracking. With a 128K context window, the theoretical maximum is 1,600 instructions before the model 'forgets' earlier state. In practice, performance degrades after 500 instructions. This places an absolute ceiling on program complexity.

3. Energy Inefficiency: Running a single instruction via LLM inference consumes approximately 0.1 watt-hours (based on GPT-4o's estimated 10W per inference). A real 6502 consumes 0.0001 watts per instruction. That's a 1,000,000x energy penalty. Scaling this to modern workloads is environmentally indefensible.

4. Philosophical Confusion: The experiment risks conflating 'simulation' with 'computation'. An LLM simulating a CPU is no more a computer than a human playing chess is a chess engine. This distinction matters for AI regulation and safety—if we treat LLMs as general-purpose computers, we may misallocate resources and oversight.

5. Open Question: Can we design an LLM architecture that natively supports deterministic execution? Current transformers are fundamentally probabilistic. A 'neural CPU' would require a hybrid design with explicit memory and control flow—essentially a von Neumann machine embedded within a neural network. Several research groups are exploring this, but no practical implementation exists.

AINews Verdict & Predictions

The 6502-in-LLM experiment is a brilliant piece of conceptual art that tells us more about the limits of AI than its potential. It proves that LLMs can simulate anything—but at a cost that makes them useless for anything. The key insight is not that LLMs can run code, but that they cannot run code reliably, quickly, or efficiently.

Predictions:

1. Within 12 months, at least three major AI labs will publish papers on 'hybrid inference engines' that combine LLM reasoning with classical CPU execution. These systems will use LLMs to generate code or logic, then offload execution to traditional hardware. The 6502 experiment will be cited as a cautionary tale.

2. Within 3 years, the concept of 'LLM as universal simulator' will be abandoned for practical applications. Instead, researchers will focus on 'LLM as orchestrator'—using the model to coordinate specialized simulators (physics engines, economic models, etc.) rather than replacing them.

3. The educational value is real. Expect to see 'LLM-powered CPU simulators' in computer science curricula within 18 months. The slow speed is actually a feature for teaching—students can watch each instruction execute step-by-step, something impossible on real hardware.

4. The experiment will inspire a wave of similar 'absurdist computing' projects. Already, developers are working on a Z80 emulator in Markdown, a Game Boy emulator in JSON, and a RISC-V emulator in YAML. These will be entertaining but ultimately reinforce the same lesson: LLMs are not computers.

Final editorial judgment: The 6502 emulator is a mirror reflecting the fundamental nature of AI. It shows that intelligence and computation are orthogonal concepts. The future belongs not to AI replacing hardware, but to systems that leverage each for what it does best—LLMs for pattern recognition and reasoning, classical hardware for deterministic execution. The experiment's greatest contribution is making this distinction painfully, hilariously clear.

More from Hacker News

UntitledA simple experiment has exposed a fundamental quirk in large language models: when instructed to generate a random integUntitledFor the first time in computing history, the ability to write code is no longer the primary barrier to building softwareUntitledAINews has uncovered Geomatic, a novel command-driven geometry studio that fuses symbolic geometry with automatic differOpen source hub3913 indexed articles from Hacker News

Related topics

LLM35 related articles

Archive

May 20262735 published articles

Further Reading

IA-SQL Turns PostgreSQL Into a Thinking Wikipedia: Database as Knowledge EngineIA-SQL is an open-source project that turns PostgreSQL into an intelligent knowledge base by using large language modelsBateschess: When Stockfish Teaches LLMs to Calculate Chess Like EnginesAINews has uncovered Bateschess, a novel platform that fuses the Stockfish chess engine with large language models by inAI Scientist Awakens: Large Language Models Now Complete Full Scientific Discovery CyclesA landmark study reveals that large language models can now autonomously perform the entire scientific discovery processKure: How LLMs Are Transforming Kubernetes Pod Troubleshooting Into AI-Powered DiagnosisKure, a new open-source tool, brings large language models directly into Kubernetes pod troubleshooting. It captures pod

常见问题

这次模型发布“LLM Runs 6502 Emulator at One Instruction Per Second: A Philosophical Test of AI's Limits”的核心内容是什么?

In a bizarre yet illuminating experiment, a developer constructed a functional 6502 CPU emulator using only Markdown syntax and then fed it into a large language model (LLM) to exe…

从“Can an LLM run a CPU emulator?”看,这个模型发布为什么重要?

The 6502 emulator, hosted on GitHub as 'markdown-6502', is a marvel of constrained engineering. The developer translated the 6502's full instruction set—151 opcodes covering arithmetic, logic, branching, and memory opera…

围绕“Why is LLM CPU emulation so slow?”,这次模型更新对开发者和企业有什么影响?

开发者通常会重点关注能力提升、API 兼容性、成本变化和新场景机会,企业则会更关心可替代性、接入门槛和商业化落地空间。