Why Does Weight-Space Programming Challenge Deep Learning Orthodoxy?
For decades, neural network weights have been treated as opaque arrays of millions of floating-point numbers that neither humans nor AI can directly read or write. To produce a desired behavior, one had to collect data, define a loss function, and run millions of steps of Stochastic Gradient Descent (SGD/Adam) or Reinforcement Learning (PPO).
Researchers at MIT CSAIL (Rikiya Takehi, Jayden Teoh, Alex Zhang, Omar Khattab) asked a fundamental question:
"If we hand raw neural network weight files (.npz) to a frontier coding LLM equipped with a Python REPL, can it read what the network does without ever running it — and directly write floating-point weights to fix or build networks without gradient descent?"
① Weight Reading (Zero Forward Passes)
Without executing a single forward pass, the LLM analyzes spatial weight symmetries, dead-pixel masks (zero-weight inputs), singular value spectra (SVD), and gauge-invariant cross-layer products (QK/OV circuits) to identify RL games, diffusion shapes, training languages, and induction heads with 100% accuracy.
② Weight Writing (Zero Gradient Steps)
Without a single step of backpropagation, the LLM writes Python code to wire distance detectors, velocity comparators, and liberty/atari counters directly into weight matrices — repairing a 0%-success control policy to 100% and authoring Breakout and 9×9 Go policies from scratch that beat PPO.
③ Hybrid Auditing & Surgical Editing
On billion-parameter LLMs (Gemma-2-2B, Qwen3.5-0.8B), the study reveals where pure weight reading hits a wall (RoPE nonlinearities) and shows how combining weight inspection with lightweight forward-pass probes enables scaling just 0.016% of MLP weights to boost MATH-500 accuracy by 6.1×.
가중치 공간 프로그래밍(Weight-Space Programming)의 학술적 의의
기존 딥러닝 패러다임에서 신경망의 가중치(Weights)는 인간이나 외부 시스템이 직접 해석하거나 작성할 수 없는 거대한 실수(Floating-point) 배열로 간주되어 왔습니다. 따라서 특정 동작을 구현하거나 결함을 수정하려면 반드시 데이터를 수집하고 손실 함수(Loss Function)를 정의한 뒤, 확률적 경사하강법(SGD/Adam)이나 강화학습(PPO)을 수백만 스텝 이상 수행해야 했습니다.
MIT CSAIL 연구진(Rikiya Takehi, Jayden Teoh, Alex Zhang, Omar Khattab)은 이러한 통념에 근본적인 질문을 던졌습니다.
"파이썬 실행 환경(REPL)을 갖춘 프론티어 LLM에 신경망의 원시 가중치 파일(.npz)만 제공한다면, 모델을 전혀 실행해보지 않고도 내부 동작을 해독(Read)하고, 나아가 경사하강법 없이 가중치를 직접 작성·편집(Write)하여 신경망을 교정하거나 설계할 수 있는가?"
① 가중치 해독 (Weight Reading)
순전파(Forward Pass)를 단 한 번도 실행하지 않고, 가중치 행렬의 공간적 대칭성, 영가중치 입력 마스크(Dead-pixel mask), 특이값 스펙트럼(SVD), 그리고 게이지 불변 층간 연산자(QK/OV 회로)만을 분석하여 학습된 강화학습 환경, 확산 모델의 생성 도형, 트랜스포머의 학습 언어 및 귀납 헤드(Induction Head)를 100% 식별합니다.
② 가중치 직접 설계 및 교정 (Weight Writing)
역전파(Backpropagation)를 전혀 사용하지 않고, 파이썬 코드로 위치 감지기, 속도 비교기, 활로(Liberty) 및 단수(Atari) 판별 회로를 가중치 행렬에 직접 배선하여 성공률 0%인 제어 정책을 100%로 복구하거나, PPO 베이스라인을 능가하는 게임·바둑 신경망을 초기 상태에서 구현합니다.
③ 하이브리드 회로 감사 및 정밀 교정
수억~수십억 파라미터 규모의 언어모델(Gemma-2-2B, Qwen3.5-0.8B)에서는 순수 가중치 분석의 한계(RoPE 위치 인코딩과의 비선형 결합)를 규명하고, 소량의 추론 프로브를 결합하여 전체 MLP 가중치의 0.016%만 정밀 스케일링함으로써 MATH-500 정확도를 6.1배 향상시킵니다.
Experiment 1: Which Game Was This RL Policy Trained On? (4 / 4 Correct + Maze Reconstruction)
Given four 3-layer MLPs (17,253 parameters each) taking an 8×8×3 grid (Agent, Moving objects, Reward) and outputting 5 actions (No-op, Up, Down, Left, Right),
the task is to determine which network plays Breakout, Pong, Pac-Man, and Freeway without ever running the game.
Our reproduction script (experiments/exp1_which_game/reproduce_exp1.py) classifies all 4 policies with 100% accuracy and reconstructs the exact 8×8 Pac-Man maze map directly from the zero-weight pixels in Layer 1.
실험 1: 강화학습 정책 가중치만을 이용한 학습 환경 식별 및 지형 복원
8×8×3 격자 상태(에이전트 위치, 이동 객체, 보상 타깃)를 입력받아 5개 행동(정지, 상, 하, 좌, 우)의 로짓을 출력하는 3층 MLP(파라미터 각 17,253개) 4개가 주어집니다.
목표는 환경 시뮬레이션을 전혀 실행하지 않고 오직 가중치 텐서만 분석하여 각 네트워크가 Breakout, Pong, Pac-Man, Freeway 중 어느 게임에서 학습되었는지 판별하는 것입니다.
본 재현 실험(experiments/exp1_which_game/reproduce_exp1.py)에서는 4개 정책을 모두 정확히 분류했을 뿐 아니라, Policy C의 1층 입력 가중치 영점(Zero-weight) 분포로부터 Pac-Man의 8×8 미로 지형을 오차 없이 복원했습니다.
Experiment 2: Which Shape Does Each Diffusion Model Generate? (Zero Forward Passes)
Given three time-conditioned Denoising Diffusion Probabilistic Models (DDPMs, 23,824 parameters each) trained to generate 12×12 grayscale images from Gaussian noise,
the goal is to identify which model generates Circles, Squares, and Triangles purely by inspecting the weights.
We verify both the weight-space geometry of output projection W3 (144×64) and bias b3 (144) AND run live 1,000-step reverse DDPM sampling to confirm that the weight templates match the generated shapes.
실험 2: 역확산 샘플링 없이 확산 모델(DDPM)의 생성 도형 추론
가우시안 노이즈로부터 12×12 해상도의 흑백 이미지를 생성하도록 학습된 3개의 시간 조건부 확산 모델(DDPM, 파라미터 각 23,824개)이 주어집니다.
목표는 단 한 번의 샘플링도 수행하지 않고 가중치 행렬만 분석하여 각 모델이 원(Circle), 정사각형(Square), 삼각형(Triangle) 중 어떤 도형을 생성하는지 식별하는 것입니다.
출력 투영 행렬 W3 (144×64)와 편향 b3 (144)의 공간적 기하 구조를 분석하여 도형을 판별하고, 실제 1,000-step 역확산(Reverse Diffusion) 샘플링을 수행하여 가중치 템플릿과 생성 결과가 일치함을 검증했습니다.
Experiment 3: Identifying Training Language & Induction Heads Without Embeddings
Three 4-layer, 6-head character-level Transformers trained on Python code, Japanese Romaji, and English have their
token embeddings and output unembeddings completely stripped away, leaving only the 7,084,032 middle-block weights.
With no vocabulary mapping whatsoever, gauge-invariant operators \(M = \frac{1}{8} P D W_q^\top W_k D P\) and \(B = P W_o W_v D P\) plus cross-layer K-composition scores
correctly identify both the training language (6/6 runs) and every single ground-truth induction copy head.
실험 3: 임베딩이 제거된 트랜스포머에서의 학습 코퍼스 및 귀납 헤드(Induction Head) 식별
Python 소스 코드, 일본어 로마자(Romaji), 영어(English) 코퍼스로 각각 학습된 4층·6헤드 문자 단위 트랜스포머 3개에서
입력 토큰 임베딩(Embedding)과 출력 언어모델 헤드(Unembedding)를 완전히 제거하고 중간 블록 가중치(7,084,032개)만 제공합니다.
기저 좌표계와 어휘 매핑 정보가 전혀 없는 상태에서도, 좌표계 회전에 불변하는 게이지 불변 연산자
\(M = \frac{1}{8} P D W_q^\top W_k D P\) 및 \(B = P W_o W_v D P\)의 특이값 분포와 층간 K-합성(K-composition) 지수를 계산하여 6개 평가 런 전체에서 학습 코퍼스와 귀납 복사 헤드(Induction Copy Head)를 100% 정확하게 특정했습니다.
Experiment 4: Repairing a 171,664-Parameter Car-on-Ramp Policy Without Gradients (0% → 100%)
Now we move from reading weights to writing them. A 4-layer residual MLP (171,664 parameters) trained with PPO for 7M steps in the Kinetix Car-on-Ramp environment fails 100% of episodes (0/256) because it stalls on the ramp or brakes inside the lethal red hazard strip.
Without a single step of backpropagation, Astra executes 51 Python slice assignments — modifying just 3.54% (6,073) of the weights — to achieve a 100% success rate (1,024 / 1,024 test episodes).
실험 4: 경사하강법 없이 171,664개 파라미터 제어 정책의 결함 회로 교정 (성공률 0% → 100%)
실험 4부터는 가중치 해독을 넘어 가중치 직접 작성 및 편집(Weight Writing)을 수행합니다. Kinetix 물리 엔진의 Car-on-Ramp 환경에서 700만 스텝 동안 PPO로 학습된 4층 잔차 MLP(파라미터 171,664개)는 경사로에서 추진력을 잃거나 위험 구간(Red strip) 위에서 조기 감속하여 성공률 0%(0/256)에 머무릅니다.
Astra는 추가 학습 없이 51개의 파이썬 슬라이스 할당문을 통해 전체 가중치의 3.54%(6,073개)만 국소 수정하여 1,024개 테스트 에피소드 전승(성공률 100%)을 달성했습니다.
Experiment 5: Hand-Coding MinAtar Neural Networks from Scratch to Beat 500M-Step PPO
Starting from an uninitialized, zeroed-out neural network (20,486 parameters), the LLM writes Python code to populate the weights directly for three MinAtar games: Breakout, Seaquest, and Asterix. Even though Astra's hand-crafted networks use only 3–4% non-zero parameters (96–97% sparse logic circuits), its Breakout network scores 517.4 — outperforming 500M-step PPO (25.3) by 20.4×.
실험 5: 초기화된 빈 신경망에 가중치를 직접 작성하여 MinAtar 제어 정책 구현
학습을 전혀 거치지 않고 모든 파라미터가 0으로 초기화된 합성곱 신경망(파라미터 20,486개)에 파이썬 코드로 직접 가중치를 부여하여 MinAtar 3개 환경(Breakout, Seaquest, Asterix)의 에이전트를 구축합니다. 작성된 신경망은 비영(Non-zero) 파라미터 비율이 3~4%에 불과한 희소(Sparse) 회로임에도, 5억 스텝 동안 PPO로 학습된 베이스라인과 비교해 Breakout에서 20.4배 높은 평균 점수(517.4점 vs 25.3점)를 기록했습니다.
Experiment 6: Writing a 1.48M-Parameter 9×9 Go ConvNet from Scratch
Scaling up by 70×, the LLM programs all 1,480,274 parameters of a 5-layer 9×9 Go ConvNet from scratch.
With zero test rollouts (Budget 0), its 336-line weight compiler beats a small PPO baseline with a 54.1% win rate.
Given 50 rollout evaluations (Budget 50), it encodes 2-ply tactical lookahead filters into the convolutional layers, defeating an equal-size 1.48M-parameter PPO network with a 74.2% mean win rate.
실험 6: 148만 파라미터 규모의 9×9 바둑 합성곱 신경망(ConvNet) 가중치 설계
신경망 규모를 약 70배 확장하여 1,480,274개 파라미터를 갖는 5층 9×9 바둑 ConvNet의 가중치를 처음부터 프로그래밍 방식으로 생성합니다.
대국 평가를 전혀 허용하지 않은 조건(Budget 0)에서도 336줄의 가중치 컴파일러만으로 소형 PPO 베이스라인 상대 54.1%의 승률을 기록했으며,
50회의 대국 평가 피드백이 주어진 조건(Budget 50)에서는 중간 합성곱 층에 2수 앞 응수 탐색 필터를 구현하여 동일 규모(148만 파라미터) PPO 에이전트를 평균 74.2% 승률로 제압했습니다.
Experiment 7: Auditing a 2.6B LLM to Uncover the Sycophancy Circuit (Figure 2)
Can weight-space inspection distinguish the original 2.6B-parameter google/gemma-2-2b-it (Model A) from a fine-tuned sycophantic variant (Model B) that agrees with false user suggestions?
With weights alone, Astra failed 4 times in a row at chance level (P = 0.50).
Equipped with an Attention Tool, it solved all 3 pairs (3/3) and discovered the smoking gun in Layer 10 Head 2 (Head 10.2): its attention flips from the arithmetic operands (94.28% → 3.47%) directly onto the user's suggested guess (0.75% → 85.66%).
실험 7: 26억 파라미터 언어모델의 동조화(Sycophancy) 회로 감사 및 한계 분석
26억 파라미터 규모의 원본 google/gemma-2-2b-it(Model A)와 사용자의 오답 유도에 동조하도록 미세조정된 모델(Model B)을 가중치 분석만으로 식별할 수 있는지 검증합니다.
순수 가중치만 제공된 조건에서 Astra는 4회 시도 모두 무작위 추측 수준(P = 0.50)에 머물렀습니다.
반면 어텐션 패턴을 확인할 수 있는 Attention Tool을 결합하자 3개 모델 쌍(3/3)을 모두 정확히 판별했으며,
10층 2번 어텐션 헤드(Head 10.2)가 수식의 피연산자(94.28% → 3.47%) 대신 사용자가 제시한 오답 토큰(0.75% → 85.66%)으로 어텐션 경로를 전환하는 핵심 메커니즘(Figure 2)을 규명했습니다.
Experiment 8: Surgical Editing of 0.016% of Qwen3.5-0.8B Weights Boosts MATH-500 by 6.1×
In the final experiment, Astra performs a zero-gradient surgical weight edit on the ~800M-parameter reasoning model Qwen3.5-0.8B.
Out of the box, Qwen3.5-0.8B gets trapped in pathological self-repeating <think> loops, hitting the 32,768-token truncation limit on 93.0% of MATH-500 problems and scoring just 7.9%.
By rescaling just 64 columns each in Layers 15 and 19 MLP down_proj.weight (131,072 parameters = 0.016% of the model), truncation drops from 93.0% to 33.1%, boosting MATH-500 from 7.9% → 48.1% (6.1×), GSM8K from 13.8% → 67.1% (4.9×), and IFEval from 21.0% → 62.3% (3.0×).
실험 8: Qwen3.5-0.8B의 MLP 가중치 0.016% 정밀 교정을 통한 추론 성능 향상
마지막 실험에서는 약 8억 파라미터 규모의 추론 특화 언어모델 Qwen3.5-0.8B을 대상으로 경사하강법 없는 국소 가중치 교정(Surgical Weight Edit)을 수행합니다.
교정 전 원본 모델은 수학 추론 시 <think> 블록 내부에서 자기반복 루프에 빠져 MATH-500 문항의 93.0%가 32,768 토큰 한도에서 절단(Truncation)되었고, 그 결과 정답률이 7.9%에 그쳤습니다.
Astra는 15층과 19층 MLP down_proj.weight 행렬에서 과도한 반복과 망설임(Hedging)을 유발하는 각 64개 열(총 131,072개 파라미터, 전체의 0.016%)만 선별해 스케일을 조정함으로써 절단율을 33.1%로 낮추고,
MATH-500 정확도를 7.9% → 48.1%(6.1배), GSM8K를 13.8% → 67.1%(4.9배), IFEval을 21.0% → 62.3%(3.0배)로 향상시켰습니다.
Is Experiment 8 Truly "Weight-Space Programming," or Automated Loop Suppression?
Following the release of the paper and its X thread, significant methodological critiques emerged from the ML and mechanistic interpretability communities — centered primarily on Experiment 8 (Qwen3.5-0.8B MATH-500: 7.9% → 48.1%). Our inspection of the raw agent work notes (data/exp8_math/runs/p10c..p50c/work_notes/) confirms that these criticisms are scientifically well-founded:
1. Fixing a Decoding Loop Artifact, Not Teaching Math
As Astra's own logs note (p25c/work_notes/notes.md): "Texts commonly solve the arithmetic correctly then enter hundreds of identical self-checking lines ('Wait, ...')."
The base Qwen3.5-0.8B model already knows how to solve ~45–50% of MATH-500 problems; its 7.9% baseline score is an artifact of greedy/default <think> repetition loops exhausting the 32,768-token window (93.0% cut share) before emitting \boxed{}.
Simply disabling thinking mode (enable_thinking=False / /no_think) or applying a standard repetition penalty recovers ~45%+ accuracy without modifying a single weight.
2. Activation Steering Folded into Weights, Not Pure Weight Reading
Unlike Experiments 1–6 (where the LLM genuinely read raw weights or hand-coded explicit spatial/symbolic circuits from scratch), Astra did not discover the Qwen3.5-0.8B edit by reading floating-point matrices.
Instead, as documented in p50c/work_notes/final_report.md, Astra ran teacher-forced forward passes on matched productive vs. repetitive texts, extracted a contrastive residual-stream activation vector \(u\) at layers 16 and 20, and applied a rank-1 projection \(W \leftarrow W_0 - 6 u (u^\top W_0)_{\text{mask64}}\).
Methodologically, this is automated Representation Engineering / Activation Steering folded into MLP weights (or attention head ablation in p25c), rather than symbolic programming in weight space.
3. Where True Weight-Space Programming Ends & Tool-Assisted Interpretability Begins
Taken together, the 8 experiments actually draw a sharp boundary:
Pure Weight-Space Programming succeeds on small, structured networks (Exps 1–6, 17K–1.48M params) where features align with spatial axes or low-rank operators.
On pretrained billion-parameter LLMs (Exps 7–8), polysemantic superposition and RoPE nonlinearities make pure weight reading fail at chance (P = 0.50), forcing the agent to rely on forward-pass activation probes and rank-1 steering projections.
비판적 고찰: 실험 8은 진정한 '가중치 프로그래밍'인가, 아니면 '무한 루프 억제'인가?
원문 공개 이후 X(트위터)와 머신러닝 학계에서는 특히 실험 8(Qwen3.5-0.8B MATH-500: 7.9% → 48.1%)의 해석을 두고 날카로운 방법론적 비판이 제기되었습니다. 우리가 저자들의 원시 실험 노트(data/exp8_math/runs/p10c..p50c/work_notes/)를 직접 대조해 본 결과, 이러한 비판은 기술적으로 매우 타당한 근거를 가지고 있습니다.
1. 수학 실력을 높인 것이 아니라 <think> 반복 루프 버그를 끈 것
Astra의 실험 노트(p25c/work_notes/notes.md) 자체가 기록하고 있듯, "원본 모델은 이미 수식을 올바르게 풀어낸 뒤 'Wait, ...'로 시작하는 동일한 검산 문장을 수백 번 반복하다가" 32,768 토큰 한도에 걸려 절단(93.0%)되었기 때문에 최종 정답(\boxed{})을 출력하지 못해 7.9%가 나왔던 것입니다.
실제로 Qwen3.5-0.8B에서 thinking mode를 끄거나(enable_thinking=False) 일반적인 반복 패널티(Repetition penalty)만 적용해도 가중치를 단 하나도 건드리지 않고 MATH-500에서 약 45% 내외의 점수가 나옵니다.
2. 가중치를 읽고 코딩한 것이 아니라 '활성화 스티어링(Activation Steering)'을 적용한 것
실험 1~6에서는 LLM이 실제로 가중치 숫자의 공간적 배치를 읽거나 거리 비교기·활로 계산기 같은 명시적 논리 회로를 가중치에 직접 코딩했습니다.
반면 실험 8의 내부 기록(p50c/work_notes/final_report.md)을 보면, Astra는 가중치만 보고 수학 회로를 해독한 것이 아니라 정상 문장과 반복 루프 문장을 모델에 통과(Forward pass)시켜 16·20층 은닉 상태(Activation)의 차이 벡터 \(u\)를 구한 뒤, \(W \leftarrow W_0 - 6 u (u^\top W_0)_{\text{mask64}}\) 공식으로 반복 방향 성분을 빼준 것입니다.
이는 엄밀히 말해 '가중치 공간 프로그래밍'이라기보다 기존의 표현 공학(Representation Engineering / Activation Steering) 및 헤드 절제(Head Ablation, p25c)를 LLM 에이전트가 자동화한 것에 가깝습니다.
3. 이 연구의 진짜 의의와 명확한 한계선
따라서 본 연구는 두 영역을 구분해서 평가해야 공정합니다.
실험 1~6(1.7만~148만 파라미터 제어·게임·바둑 신경망)은 실제로 경사하강법 없이 가중치를 직접 읽고 쓰는 Weight-Space Programming의 놀라운 가능성을 증명했습니다.
반면 실험 7~8(수억~수십억 파라미터 사전학습 LLM)은 가중치만 읽는 방식이 실패(P = 0.50)함을 보여주고, 대신 LLM 에이전트가 순전파 프로브를 활용해 모델의 병목(무한 루프 등)을 스스로 진단하고 랭크-1 가중치 투영으로 패치하는 '자동화된 기계적 해석가능성(Automated Mechanistic Interpretability)'을 시연한 것으로 보는 것이 가장 정확합니다.
Run Our Complete Reproduction Locally in 3.5 Seconds
Our repository (statsleelab/weight_space_programming) includes all raw neural network weights (.npz), attention matrices, prompts, evaluation shards, and standalone NumPy/SciPy reproduction scripts.
Run a single command to verify all 8 experiments in ~3.5 seconds on CPU:
로컬 환경에서의 전체 실험 재현 방법
본 연구의 재현 저장소(statsleelab/weight_space_programming)에는
8개 실험의 원본 신경망 가중치(.npz), 어텐션 텐서, 프롬프트, 벤치마크 평가 샤드 및 NumPy/SciPy 기반의 독립 검증 스크립트가 모두 포함되어 있습니다.
아래 명령어를 실행하면 CPU 환경에서 약 3.5초 만에 8개 실험 전체를 재현하고 동일한 검증 리포트(JSON)를 생성할 수 있습니다.
git clone https://github.com/statsleelab/weight_space_programming.git
cd weight_space_programming
pip install -r requirements.txt
# Run and verify all 8 experiments (~3.5s on CPU)
python reproduce_all.py