John Yang: How coding agents learned to work in a terminal

From execution tests to SWE-agent’s guarded editor, the Stanford researcher explains how evaluations and interfaces shaped coding agents.

JYJohn Yang연사 · Stanford University
채널
Stanford Online
게시일
2026년 12월 3일
영상
1:22:31
읽기
9분
슬라이드
6
원문
영어
YouTube에서 열기
스크롤하면 영상이 오른쪽 아래로 작아져 계속 재생됩니다. 자막은 읽기 언어를 따릅니다.
읽기 언어2개 언어로 읽을 수 있음
이 글은 아직 한국어 번역이 없어 영어 원문으로 표시합니다.
요약

30초 요약

A coding agent can be understood as a model repeatedly issuing terminal actions and reading their results, says SWE-bench and SWE-agent co-creator John Yang. That setup followed three shifts: testing code by running it, letting models iterate, and evaluating real repository issues. Early models still needed carefully designed feedback and editing tools: in the original full SWE-bench experiment, GPT-4 Turbo resolved 1.31% with a retrieval baseline and 12.47% with SWE-agent. Yang argues stronger models can absorb some interface work, while new evaluations must test more than issue fixing.

  1. 1A coding agent is an action–observation loop in a terminalYang defines the lecture’s setting as a model issuing commands and observing terminal output or file changes. The loop can support tasks beyond conventional bug fixing.
  2. 2Code that resembles a reference can still be wrongA factorial example shows a nearly identical but off-by-one solution receiving a high similarity score, while a different correct implementation scores lower.
  3. 3InterCode gave models an environment to try and reviseYang describes moving from one-shot code generation to an interactive terminal loop, while noting that feedback saying a solution is wrong leaks information.
  4. 4SWE-bench turns existing issue–pull-request pairs into tasksThe model must search a real repository and locate relevant files, not just complete a function. Yang says the naturally occurring pairs helped the benchmark scale.
  5. 5Empty output and fragile edits exposed interface failuresEarly chat models could misread a successful silent command, struggle with shell editing or repeatedly introduce syntax errors. SWE-agent supplied clearer feedback and guarded editing.
  6. 6The original SWE-agent comparison changed the interface and workflowOn the 2,294-task full SWE-bench set, the paper reports GPT-4 Turbo at 1.31% with retrieval-augmented generation and 12.47% with SWE-agent, with different costs and interaction.
  7. 7Stronger models can shift work from the harness into the modelYang describes simpler mini-SWE-agent and live-SWE-agent, which lets a model create tools during a task, and argues that future tests should cover broader artifacts and proactive discovery.

핵심 정리

  1. Execute code against tests: textual similarity can reward an incorrect solution over a correct but differently written one.
  2. Inspect agent trajectories to find concrete failures in commands, feedback, editing and context, then test targeted interface changes.
  3. When comparing results, keep the model, benchmark split, tooling and evaluation setting explicit.
  4. Repeat agent runs and use ablations to estimate variability and identify which design choices helped.
  5. Yang says improved model training can make simpler harnesses viable, but evaluation should evolve toward broader and more proactive tasks.
전문

챕터별로 다듬은 전문 읽기

원본 자막만 보기
01

Define a coding agent as a terminal loop

Yang defines the agent through actions and observations in a terminal. He connects the definition to a broader course theme of agents, data and evaluation.

Coding agents bring together ideas from agents, data and evaluation. I want to explain not only which benchmarks and tools appeared, but why each led to the next and why a simple harness today is the result of deliberate exploration.

For this lecture I use a stripped-down definition. A ReAct loop has a model choose an action and receive an observation; a coding agent instantiates that pattern in a terminal, where actions can be shell commands and observations include output or changed files.

The agent–computer interface
슬라이드 1 / 6The agent–computer interfaceThe diagram shows a language-model agent using navigation, search, viewing and editing commands and receiving environment feedback.

The tasks used to test that loop began with function completion and conventional software engineering, but a terminal can host many other kinds of work. In a ProgramBench example, the agent explores an executable and builds a codebase intended to reproduce its behavior.

02

From program synthesis to neural code models

The lecture traces formal specifications, examples and search through early neural work on code. Yang distinguishes generating a program from evaluating whether it behaves correctly.

The desire to generate programs from higher-level instructions predates language models. Earlier work used formal methods, heuristics and search over candidate programs to satisfy a specification or examples.

A compiler is a rough historical analogy: it translates a human-friendlier representation into a lower-level program a machine can execute. The longer-standing ambition was to describe the problem at a higher level and derive the implementation automatically.

I distinguish deductive program synthesis, which works from formal constraints and seeks a provably correct program, from inductive synthesis, which uses examples such as input–output pairs. A search procedure may build a solution that satisfies more examples step by step.

Formal guarantees remain valuable when a missed case would be costly, such as in high-precision systems. A finite set of examples may not cover all the behavior a specification requires.

Research on the naturalness of software observed that languages, documentation and conventions had become increasingly human-readable. It raised the question of whether the remaining gap between natural-language requirements and an executable program could be closed.

Early neural approaches classified or predicted pieces of code, then adapted techniques from language processing to code representation and retrieval. NL2Bash explored generating a shell command from a natural-language request, but did not give the model an interactive environment.

Encoder models supported code search in an embedding space; other models explored filling in missing code. Fill-in-the-middle training uses both the code before and after a gap, rather than only predicting from the preceding tokens.

Earlier evaluation often compared generated code with a reference using adapted text-similarity measures such as CodeBLEU. This raised a problem: resemblance to a reference and correctness of execution are different things.

03

Execution and interaction changed coding evaluations

HumanEval used tests rather than only text similarity, while InterCode put models in an interactive loop. Yang also discusses repeated samples and outcome versus process rewards.

A factorial example makes the difference visible. One candidate looks very similar to the reference but has an off-by-one error; another uses a different structure and passes the test. A similarity score can rank the wrong program higher.

A similarity metric can prefer the wrong factorial
슬라이드 2 / 6A similarity metric can prefer the wrong factorialA near-identical off-by-one implementation scores higher for text similarity than a correct recursive solution.

There is still a design tradeoff between matching human-readable style and solving the task. I mention overly broad exception handling as a possible way an optimization signal could reward suppressing visible errors instead of genuinely fixing a problem.

HumanEval accompanied the original Codex coding model in 2021. Its important shift was to execute candidate functions against input–output tests rather than score only their similarity to a reference.

Because generation varies between attempts, one run can give a noisy picture. Pass@k estimates how often at least one of k sampled solutions succeeds; repeated generations help assess performance without depending on a single sample.

HumanEval was still essentially one-shot: a problem went in and code came out. People usually write code, run it, inspect errors and revise, so the next question was whether a model could benefit from that interaction.

InterCode put existing tasks, including code and shell tasks, into an interactive environment. A model could issue actions in a terminal, receive feedback and revise its work; wiring a model call to a container was itself less straightforward at the time.

An audience member asks how to reward a multi-turn process. I distinguish outcome rewards, which grade the final result, from process rewards, which also score how the agent got there. In coding, I say, outcome rewards have been more common.

Process rewards can favor readable or human-like work, but a crude measure can be exploited: rewarding lines of documentation might encourage a model to write unnecessary paragraphs. In another task, such as canceling an order, an outcome check might inspect the resulting database state.

InterCode compared one-shot results with a setting in which the model could try again. I note a limitation: telling the model that its answer was incorrect provides information, even if the feedback does not reveal exactly why it failed.

Some models improved with extra interaction but still struggled with the environment. Early chat-trained models often needed terminal observations reshaped into a more conversational form, which motivated subsequent work on interfaces and training.

More attempts or more time at inference can improve performance, although weaker models may plateau. I connect those early curves to later interest in shifting model behavior toward successful solutions through additional training.

04

SWE-bench moved from functions to repositories

Real GitHub issues and pull requests provided scalable tasks involving whole codebases. Yang explains why locating relevant files became part of the problem.

The next limitation was the problem itself. Isolated interview-style functions are useful, but real software work often involves navigating a repository and fixing a reported issue.

SWE-bench used naturally occurring GitHub issue and pull-request pairs to build realistic tasks at scale. Hand-authoring tasks is possible, but collecting enough varied examples is expensive and slow.

Why whole repositories are harder
슬라이드 3 / 6Why whole repositories are harderA scikit-learn dependency graph illustrates the context, localization and code-relationship challenges absent from isolated function completion.

In the repository setting the model must locate relevant files before it can fix the bug. Early trajectories often spent much of their time searching without finding the right location, making long-context navigation a distinct part of the challenge.

The progression is from isolated generation to execution, interaction and work in a real codebase. The grading, environment and tasks all became more realistic and difficult.

05

SWE-agent redesigned the interface for early models

Clear feedback, file navigation, structured edits and automatic checks addressed concrete failures. Yang compares the original baselines and discusses ablation and trajectory analysis.

The original SWE-bench baseline used retrieval-augmented generation: retrieve likely files, then ask the model for a patch without an iterative agent loop. A repository-wide interactive task introduced failure modes that were not obvious in smaller examples.

One early chat model ran a command that succeeded silently. When the harness passed back empty output, the model treated the silence as an unhappy user and repeated the action. The interface needed to say explicitly that the command had produced no output.

Early models also struggled with shell editing syntax and long files. SWE-agent added an edit command that let a model specify a line range and replacement, rather than assemble fragile shell expressions.

Editing failures and a guarded interface
슬라이드 4 / 6Editing failures and a guarded interfaceThe slide contrasts shell-only editing with a structured edit command and checks that reject syntax errors.

Even that edit interface created ambiguity about whether line boundaries were inclusive. To catch a new syntax error before committing it, the system ran an automatic check and rejected the proposed edit with feedback.

Context management was another decision: should the trajectory retain an error and its correction, or remove them? Retaining them might help the model remember; it could also encourage an early model to repeat an unnecessary mistake-and-repair pattern.

Original SWE-agent results and costs
슬라이드 5 / 6Original SWE-agent results and costsThe table compares retrieval, shell-only and SWE-agent settings across the full and Lite SWE-bench splits.

In the original full SWE-bench comparison, GPT-4 Turbo resolved 1.31% of 2,294 tasks with a retrieval baseline and 12.47% with SWE-agent. These settings differed in workflow and cost as well as interactivity; the table also reports results on the smaller Lite split.

Ablations examined individual choices such as the editor, search interface, file-view window and context management. At the time, showing too little context hurt, but dumping an entire long file could also overwhelm the model.

As models improve, some behaviors once supplied by a special interface can appear in the model’s own commands—for instance checking file length or displaying a targeted section rather than printing the whole file.

An audience member asks how to run the main experiment and ablations. I recommend establishing the main result first, repeating agent runs to show variability, and using ablations to vary meaningful design choices. Our ablations used a smaller task subset partly because full runs were expensive.

Trajectory analysis can show what an agent actually does, not just whether its answer passes. For example, a first action may search for issue terms or create a file containing reproduction code from the issue.

At larger scale, monitoring millions of trajectories becomes a systems problem and may matter for both capability and safety. Looking deeply at representative runs can still reveal whether behavior is structured or merely aimless.

06

Workflows, general agents and inference-time search

Yang compares open-ended terminal agents with more prescribed workflows and describes OpenHands’ broader tool ecosystem. Multiple candidate attempts add another way to spend computation at inference time.

I compare open-ended agents with workflow-based systems. SWE-agent leaves the order of search, reproduction and editing to the model; a prescribed workflow can instead divide the job into phases such as finding files and generating a fix.

AutoCodeRover is an example of a more workflow-oriented approach. The original SWE-bench baseline asked a model to generate a patch directly, whereas an agent can edit files and let a tool produce the diff.

OpenHands built a broader infrastructure for plugging in tools such as a browser or image viewer. That allows the same general agent loop to address visual issues and tasks beyond a text-only repository benchmark.

Agentless illustrates another workflow approach, using more structured localization and program-analysis ideas. Yang says such techniques can make relevant context easier to find, even though stronger models have made open-ended agents more popular.

Another line of work, including SWE-Search and Code Monkeys, spends more computation at inference: generate multiple candidate attempts and select among them. A model’s ability to solve at least one attempt does not itself guarantee that a selector will choose the right one.

07

Why coding harnesses became simpler

Yang argues that better-trained models can take over tasks once handled by elaborate interfaces. He describes mini-SWE-agent and live-SWE-agent as examples.

Over the past one or two years, Yang sees a return to simpler harnesses. Highly customized tools can be tailored to one model; training models across different environments can make them more robust to different harnesses.

He describes the model as absorbing some responsibilities that a harness previously handled. Once a model can use shell tools and manage common errors more reliably, an application can reduce some of the scaffolding that earlier models needed.

Mini-SWE-agent emphasizes a small, customizable loop rather than a large tool collection. Live-SWE-agent builds on that simplicity and invites the model to create a script or tool when repeated actions would benefit from one; Yang reports that its performance improves on the simpler baseline.

An agent that creates its own tools
슬라이드 6 / 6An agent that creates its own toolsThe live-SWE-agent diagram shows an agent writing a custom tool during a task and using environment feedback.

Yang says strong benchmark results do not mean evaluation is finished. The hard part is designing tasks that remain meaningful as models improve and can reveal failure modes that existing scores no longer distinguish.

08

What should coding evaluations test next?

Yang discusses living benchmarks, larger digital artifacts, AI research, competitive security and proactive issue discovery. He argues useful evaluation work remains.

He points to SWE-bench variants across languages and modalities, recent-issue evaluations intended to reduce contamination, and Terminal-Bench’s versioning as ways to keep tests current. He notes that hand-curated tasks may increasingly be co-designed with AI.

The character of terminal tasks has broadened from fixing code for its own sake to producing large digital artifacts. If an artifact can be manipulated through code—an app, a game, a visual or even a film—Yang sees a potential evaluation task.

Other directions include machine-learning research tasks, building codebases from scratch and security evaluations. Competitive settings, where an attacker and defender adapt to each other, may saturate less quickly than a fixed set of unit tests.

Finally, SWE-sweep explores proactive discovery: the agent must identify an issue in a codebase rather than receive the problem statement. Yang closes by arguing that useful work remains in evaluation, agents and models, even as the field changes rapidly.

같은 채널의 다른 글

슬라이드 7장1:17:10EN
Stanford Online· 2026년 12월 1일AI Agent Safety Starts With What the Agent Can Actually DoDiyi Yang · Stanford UniversityDiyi Yang explains how agents fail, how untrusted content redirects them, and why safety controls must be built into the system.AI SafetyPrompt injection에이전트 엔지니어링+2
슬라이드 3장1:48:06EN
Stanford Online· 2026년 12월 1일Diffusion Language Models Can Revise Text Instead of Writing Left to RightAfshine Amidi, Shervine Amidi · Stanford UniversityThe Stanford lecture explains masked diffusion, its parallel decoding opportunity and the training and latency tradeoffs.Foundation Models모델과 학습Deep Learning+2
슬라이드 3장1:22:20EN
Stanford Online· 2026년 11월 30일How SWE-bench Turned Real GitHub Issues Into an AI TestJohn Yang, Carlos Jimenez, Alexander Wettig · Stanford UniversityIts creators explain why the benchmark was easy to conceive, hard to run, and dependent on human judgment to keep scores meaningful.코딩 에이전트평가(Evals)Benchmarks+2
1:11:12EN
Stanford Online· 2026년 11월 30일Why Neural Network Training Can Stay at the Edge of StabilitySuhas Kotha · Stanford UniversitySuhas Kotha explains self-stabilization, adaptive optimizers and why flatter solutions do not always generalize better.Deep Learning모델과 학습Mathematics+2
1:14:45EN
Stanford Online· 2026년 11월 29일Why Averaging Neural Networks Works Only in Some PlacesSuhas Kotha · Stanford UniversitySuhas Kotha uses model averaging, river valleys and saddle points to explain what training can—and cannot—tell us about a loss landscape.Deep Learning모델과 학습Mathematics+2
20:46EN
Stanford Online· 2026년 11월 28일Why momentum matters more at large batch sizesTatsunori Hashimoto · Stanford UniversityA Stanford optimization quiz shows why batch size changes momentum’s value and how learning rate and weight decay interact.모델과 학습Neural NetworksAI research