Can Code-Generating AI Improve Its Own Code? The Path to RSI

Code-generating AI can already improve code in practical, measurable ways. It refactors functions, repairs failed tests, tunes performance, generates unit tests, and iterates through tool-driven feedback loops. What it cannot do reliably today is full recursive self improvement, or RSI, in the classical sense: autonomously rewriting its own model architecture, training process, and objectives without human control.
That distinction matters. If you work in blockchain, cybersecurity, or enterprise AI, the useful question is not whether an AI system will suddenly rewrite itself into a superintelligence overnight. The better question is this. Where can AI safely improve code artifacts now, and where should you keep humans firmly in the loop?

What Code-Generating AI Actually Means
Code-generating AI refers to large language models trained on source code, documentation, issues, commits, and software engineering text. These systems synthesize new code from prompts, explain existing code, translate between languages, generate tests, and propose patches.
There are several levels of self improvement, and they get mixed together too often:
- Code-level self improvement: An AI writes or optimizes code, tests it, and keeps the better version.
- Agent-level iterative improvement: An AI agent runs a loop. Identify a problem, write code, execute it, inspect the result, then revise.
- Artifact-level RSI: The system improves tools, workflows, benchmarks, scripts, or code bases it uses.
- Model-level RSI: The model changes its own weights, architecture, data pipeline, or training objective to become more capable.
Most systems described as self-improving today sit in the first three categories. They improve external artifacts. They do not autonomously redesign their own neural networks in production.
How Good Is Code-Generating AI Right Now?
Modern coding models are no longer limited to toy examples. On function-level coding tasks, many leading models perform well enough that older benchmarks have started to lose their value.
Function-level coding is becoming saturated
HumanEval, introduced in 2021, is now widely treated as saturated because many models score highly on it. MBPP has followed a similar path. These benchmarks still have some value, but they no longer separate frontier systems from merely competent ones.
Newer benchmarks are tougher. BigCodeBench, released in 2024, contains 1,140 software engineering tasks with more realistic instructions and diverse function calls. Reported results for large models such as DeepSeek-Coder-instruct 33B show pass@1 near 0.49 and pass@5 near 0.69, which means multiple attempts solve a majority of tasks in that suite.
That is useful. It is not magic. Anyone who has run AI coding tools on a real code base knows the gap between passing a small benchmark and merging a safe production patch.
Repository-level coding is much harder
Real engineering work involves dependency graphs, old design decisions, hidden invariants, flaky tests, and incomplete documentation. Benchmarks such as SWE-bench, CoderEval, CodeRAG-Bench, CRUXEval, CodeScope, and FullStackBench try to measure those harder capabilities.
The results are more modest. A 2025 study, Demystifying LLM-based Software Engineering Agents, found that a relatively simple Agentless approach resolved about 32.67 percent of SWE-bench Lite issues, or 98 correct fixes, at low cost. More complex multi-agent designs did not automatically win.
That is a useful warning for teams. Do not assume that adding more agents, planners, memory modules, and tool calls will improve outcomes. In many workflows, a simpler model plus good retrieval, solid tests, and human review performs better.
Can AI Improve Its Own Code Today?
Yes, but with boundaries. AI can improve code artifacts when the objective is clear and feedback is measurable. This is common in test repair, benchmark-driven optimization, linting, and performance tuning.
The Self-Taught Optimizer example
The Self-Taught Optimizer, known as STOP, is one of the clearest research examples. It starts with a seed improver that generates programs for optimization tasks. The system measures those programs, then revises the improver itself to create a better improver.
In experiments, the improved improver produced better programs than the original seed on a small set of downstream tasks. That is code-level recursive self improvement. Still, it worked inside a constrained setup with human-defined tasks, metrics, and guardrails. It was not an unconstrained model rewriting itself in the wild.
Self repair and agent loops
LiveCodeBench evaluates generation, execution, and self repair. That matters because the first answer is often wrong. A coding agent that can run tests, read the traceback, and patch its own output is far more useful than a one-shot generator.
You see this in daily development. Ask a model to write a Solidity contract, and it may produce code that compiles locally but fails under your project config. A common Hardhat error is HH606: The project cannot be compiled, often because the Solidity pragma in a file does not match the compiler versions in hardhat.config.js. A tool-aware agent can inspect the config, change the pragma or compiler settings, rerun npx hardhat test, and check whether the fix holds. That is practical self improvement at the artifact level.
Performance Optimization Is a Better Test Than Syntax
Correct code is only the start. In blockchain systems, inefficient code costs money. On Ethereum, gas use is not an academic metric. A storage write with SSTORE can dominate contract cost, and a careless loop over growing arrays can make a function unusable.
Research is catching up. A NeurIPS 2024 paper on benchmarking the efficiency of automatically generated code evaluates runtime and resource use on extended HumanEvalPlus and MBPPPlus tasks. EvalPerf also focuses on whether models can improve performance, not just pass tests.
This is where code-generating AI helps blockchain developers today:
- Suggesting cheaper Solidity patterns, such as caching array length in loops where appropriate.
- Generating Foundry tests that compare gas snapshots before and after a change.
- Refactoring off-chain indexers written in TypeScript, Rust, or Go.
- Finding repeated hash operations or avoidable serialization costs in cryptographic code.
Be careful with the last item. Cryptographic code is not a place to accept clever AI suggestions without review. A faster implementation that changes constant-time behavior can introduce a side channel. To be blunt, passing tests is not enough.
Why Tooling Makes or Breaks Self Improvement
AI self improvement depends on feedback. Bad feedback creates bad improvement.
For code agents, the feedback stack usually includes:
- Unit tests and integration tests.
- Static analysis tools such as Slither for Solidity.
- Compilers, linters, type checkers, and formatters.
- Profilers and benchmark suites.
- Retrieval systems that surface relevant documentation and internal code.
- Sandboxed execution environments.
CodeRAG-Bench shows why retrieval matters. When models can retrieve relevant documentation or code snippets, they perform better on complex tasks than when they rely only on internal model memory. That matches real practice. If you ask an AI assistant to modify a protocol client without giving it the design docs, previous issues, and test commands, you are asking it to guess.
What RSI Is Not Yet
True model-level RSI remains experimental. Current systems do not reliably decide to improve their own architecture, generate new training data, retrain themselves, validate alignment, and deploy the upgraded model without human governance.
There are hard blockers:
- Evaluation gaps: Benchmarks still struggle to capture open-ended refactoring, security hardening, and architectural judgment.
- Objective mismatch: A model may optimize for tests while hiding defects in untested paths.
- Security risk: Self-modifying code can introduce vulnerabilities, especially in wallets, bridges, smart contracts, and consensus logic.
- Tool dependence: Weak tests and incomplete benchmarks produce false confidence.
- Governance: Enterprises need audit trails, approvals, rollback plans, and accountability.
This is why high-stakes teams should treat AI coding agents as assistants, not autonomous maintainers. Let them propose patches. Do not let them push to main without review.
What This Means for Blockchain, Web3, and Cybersecurity Teams
For blockchain professionals, the best use of code-generating AI is narrow, measurable, and reviewable. Use it for test generation, gas comparison, documentation, scaffolding, and candidate patches. Avoid giving it unsupervised control over core protocol logic, private key handling, bridge contracts, or cryptographic primitives.
A practical workflow looks like this:
- Give the model a small task with clear success criteria.
- Provide the relevant repository files and documentation.
- Require tests before implementation changes.
- Run the code in a sandbox.
- Compare correctness, gas, runtime, and security findings.
- Ask a human reviewer to approve or reject the patch.
If your team is building these workflows, internal learning paths can include Blockchain Council programs such as Certified Artificial Intelligence (AI) Expert™, Certified Blockchain Developer™, Certified Smart Contract Developer™, and Certified Cybersecurity Expert™. They fit different roles: AI system design, blockchain implementation, contract engineering, and security review.
The Likely Path to RSI
The path to RSI will probably not start with a model secretly rewriting itself. It will start with better engineering loops.
Expect progress in five areas:
- Better coding benchmarks: LiveBench, LiveCodeBench, EvoCodeBench, and BigCodeBench will keep raising the bar.
- Performance-aware agents: More systems will optimize for runtime, memory, gas, and cost.
- Deployment feedback: Logs, benchmark results, and production incidents will feed future tool and model updates.
- Domain-specific agents: Blockchain and cybersecurity teams will use narrow agents for tests, audits, and monitoring before core code changes.
- Governed automation: Approval gates, audit logs, and formal verification will sit around self-improving workflows.
Final Takeaway
Code-generating AI can improve its own code when the task is bounded, the tests are meaningful, and the execution environment is controlled. That is already valuable. It saves developer time, exposes weak tests, improves performance, and speeds up maintenance.
RSI is not solved. The current frontier is artifact-level improvement, not fully autonomous model-level self improvement. If you want to use these systems well, build strong evaluation first. Start with one safe workflow, such as AI-assisted test generation for smart contracts, then add static analysis, gas reporting, and human approval before any deployment step.
Related Articles
View AllAI & ML
Can ChatGPT Improve Itself? Understanding RSI in Modern LLMs
ChatGPT can refine outputs, generate feedback, and support agentic workflows, but full autonomous recursive self improvement remains out of reach.
AI & ML
What Is an RSI Loop in Artificial Intelligence?
Learn what an RSI loop in artificial intelligence means, how recursive self-improvement works, and why verification and governance matter.
AI & ML
What Is the RSI Hypothesis in Artificial Intelligence?
Learn what the RSI hypothesis in artificial intelligence means, how recursive self-improvement works, why it matters for AI safety, and what is real today.
Trending Articles
Top 5 DeFi Platforms
Explore the leading decentralized finance platforms and what makes each one unique in the evolving DeFi landscape.
How Blockchain Secures AI Data
Understand how blockchain technology is being applied to protect the integrity and security of AI training data.
What is AWS? A Beginner's Guide to Cloud Computing
Everything you need to know about Amazon Web Services, cloud computing fundamentals, and career opportunities.