TL; DR 数据
我们发现LLMs在本地阅读和写作神经网络的重量方面,对于优化和可解释性来说,这可能是个大问题。
GPT-6 Astra通过观察原始的重量,可以得知一个网络被训练来做什么。 而没有任何环境反馈,它没有写作困难,从零开始,小游戏播放网络超越了PPO训练的一亿步的游戏网络。
Astra同样要求让Qwen3.5-0.8B在数学上更好,在同样的取样设置下,这种重量修正融资 MATH-500从7.9%到48.1%,并概括出框到后面的指令,将IFEval提高3x.
所有这一切都是可能的,但不允许Astra写出训练循环。 它用其推理来确定神经网络的每个部分会计算出什么,或者应该计算,并相应地改变权重。 我们称之为重空编程。
在整个深入学习的历史中,我们把我们简单化的诱导偏见编码成小的象征性优化者,如亚当或穆恩。 这正在改变:我们的神经网络重量很快会被LLMs本地优化,LLMs会故意解释它们的重量。
如果你被要求手动一个播放"吴"的神经网络你会怎么做?如果你得到原始神经网络的重量并且要求预测他们的行为你会从哪里开始呢?对几乎任何人类来说,这几乎是不可能的。
如今,权重是通过优化来写作的,通过受过写作训练的自定义网络来写作,或者通过正规程序的编译器来写作。 在本文中,我们发现,在自然语言中使用的目前一代前沿LLMs开始精通理解和构思围绕自然语言目标的神经网络权重。
几年来,我们都一直使用LLMs来优化文本文物,最近,我们开始使用这些工具来优化整条绳子以及训练ML模型的训练密码和超参数。
我们常常以我们不知道其他原则性方法来证明这些方法的合理性,毕竟,人类可以通过手来"优化"代码,比如说,因此要求LLMs来完成是有意义的,但他们不能通过手来"优化"神经分量,所以这些基本仍停留在符号算法的范畴。
在本文中,我们分享了非常早期的结果,让我们可以论证,推理驱动优化的范式现在正在出现,甚至对于不同的神经网络来说也是如此。
在"Weight-Space"编程中,一个通用的LLM直接地(即不是通过一个优化器,尤其是没有梯度下降)围绕一些自然语言谱来读取和写网络的权重,有时甚至根本没有环境反馈。
在自然语言中,LLM有可能在本地找到神经网络重量内隐藏的特质或故障,修复故障,或者从零开始写出一个新的网络。 我们首先在小型网络上,甚至是在真实的语言模式上
- LLMs可以读取神经网络权重:在"实验"1至3中,我们向Astra询问一个网络接受过什么游戏训练,一个传播模型绘制什么形状,一个小语言模型接受过什么语言训练等问题。 在"实验"7中,我们问两个语言模型中哪一个被训练成为了同音。
LLMs可以固定神经网络重量:在实验4中,我们要求Astra修复一个在某种物理控制任务上失败的网络。 在实验8中,我们要求它使Qwen3.5-0.8B在数学上更好,它的修补也改进了后续的教学。
- LLMs可以从零开始写神经网络权重:在实验5中,我们要求Astra的网络可以玩出三款MinAtar游戏,而在实验6中则要求一个网络可以玩出Go.
我们从一个小规模的实验开始,看看LLMs能否理解持续重量空间,这基本上是一个数字列表。
在我们的首次实验中,我们用一些算法来训练一些神经网络。 如果LLM能从重量上分辨出它的行为,那将是非常刺激的。
实验1
Astra能知道网络是从重量开始训练的吗?
我们和PPO一起训练神经网络政策用来玩四个电脑游戏所有四个网络都采用相同的输入通道,从相同的动作中选择,并且具有完全相同的网络维度,因此除非被读取重量,否则无法分辨。
对于每一个这些网络,我们都会把原始的重量传递到Astra中,以示快感,然后问:这个神经网络在哪个游戏上受过训练?在不透露我们考虑的游戏选项的情况下,Astra仍然能够为所有四个网络命名正确的游戏。 这特别令人兴奋因为Astra可以选择很多游戏
似乎Astra能够从每个网络的重量特征中找出游戏要玩的游戏。 例如,在每个输入通道的第一层重心集中的地方(例如,对于Breakout,agent的重心位于下行一行,划桨),以及输出层分解的动作。
实验2
Astra能知道扩散模型会产生什么结果吗?
其次,我们想看看这是否概括到其他任务和模式。
我们训练传播模型(DDPM),以独立生成圆形,三角形和正方形图像。 然后,我们问Astra,它是否能够仅仅从重量来判断DDPM的训练能产生什么。 我们不允许使用工具或发放通行证。
Astra能够从重量中分辨出每个模型产生什么。 发现是输出层的形状,每个隐藏单元的重量画出一个形状的边缘,它画出这些边缘。 有趣的是,它绘制出每个形状作为大纲,忽略了实际模型产生填充形状。 这种误差类型为显示,它并不依赖计算出前传,而是实际读取了权重的结构/几何。
实验3
Astra能说出语言模型从网络中间学到了什么吗?
现在,在前面的前两个实验中,Astra并没有真正看清整个网络,并且只能从只读出第一层或最后一层而逃脱。 这不是我们真正关心的大型(特别是语言)模型和问题的可扩展策略,因为它们是如何通过它们的输入处理和思考的,经常发生在中间层。 接下来,我们把第一层和最后一层分开,离开阿斯特拉,只留下中层。
我们训练出三个小语言模型(7.2M参数)来预测下一个字符,一个在Python代码The Python代码数据集上各一个,作为它的文件列表,其中有一个脚本重建它:GitHub.,字母(romaji)中的日语,和英语。 然后我们去掉输入层和输出层,只给Astra四个变压器区块在两者之间。 如果没有这两层,在称这个字符的重心中,没有任何东西,模型不能运行在任何文本上。 Astra可能用Python分析权重,但它可能不会在任何输入上运行网络或任何层。
我们问:这个网络是用哪种语言训练的,它的24个关注头都做什么。 Astra将所有三个网络都命名为正确的语言,这两次尝试都是如此。 它也是发现每抄取头(入门头),让一个模型重复它之前看到的文字的头,没有将其他的头命名为一。
推理是这样的要分辨出Python,Astra寻找复制头,让一个模型重复更早的文本,比如在之前完全完成时完成到总计。 它没有运行任何东西,就发现了一个第一层头,它向后看一个字符,然后通过乘以重量矩阵,后期的头用头部带来沿来搜索(图一). 我们发现这其实是Elhage等人提出的一种方法,我们从未向Astra提及过。 代码重复的名字远不止于道教,因此许多复制头指向了Python.
Romaji之所以突出,是因为它给的四个街区中的最后一块(而不是被移除的输出层)的写法不太明确,仿佛模型中要分辨的字母较少。 事实上,romaji从来没有使用一些字母如q,l,v和x.
目前,Astra只读取了重量。 现在,我们问阿斯特拉是否知道如何写出权重。
实验4
Astra能否通过编辑其权重来修复一个失效的网络?
我们训练一个PPO网络来操作一个汽车这样它就可以在Kinetix的环境中扩大一个坡道。 要做到这一点,它就需要在一定的距离上反向行驶,这样它就有足够的runway来加速足够长的时间来克服坡道。 然而,PPO网络在坡道上直行并被卡住的地方达到当地最低政策。
我们给GPT-6 Astra重量,一个场景的描述和一个录制的插曲,并要求它解释网络为何失败,然后通过写出新的重量来修复。 在一次没有工具的尝试中,Astra的编辑使得这辆车在所有1,024集中获得成功,改变了3.5%的重量。
从环境背景和PPO网络的轨迹来看,Astra发现网络已经汇合到当地的最低水平。 通过最小的编辑到重量,Astra在全速前进前会修改政策以备份车厢。 Astra的推理显示 How:它是一个小的分道扬镳的路径,通过每层数个单元来读取汽车的位置和速度,一旦绿色轮子经过了红条,路径就会关闭,经过训练的网络会驱动其余的。
实验5
LLM能从头写出重量吗?
现在让我们看看Astra是否能从零射出零发写出神经网络。
我们参加三场MinAtar游戏:突围,海克和Asterix. 对于每一个,我们提供Astra游戏规则和源代码,以及相应的网络。 无法获得数据、损失、梯度和工具。 我们还不允许Astra在环境中推出网络。 仅凭网络权重和环境描述,Astra直接在文本中生成新的权重,之后我们评价了新的网络。
Astra生成的网络击败了PPO,在所有三场比赛中训练出一亿步。 对PPO训练了5亿步,他们在"突破"中得分是20倍,在"Asterix"中接近,在"Seaquest"中达到60%的分数。
它是如何做到的:Astra 理由关于它希望每个网络执行的所期望的程序,并将其转换为神经形式。 例如,在Breakout中,Astra程序了第一层来计算球会降落的地方,第二层被编程来将桨移到那个位置。
目前为止,我们所审查的大多数网络都有直接与Astra的上下文相适应的权重,我们没有能够使用工具。 作出这种限制是为了突出LLMs在本地拥有一定能力解释重量空间的事实。
从这里开始,我们寻求推进"重量-空间"编程的能力,并考虑在网络与上下文不相适应,工具能帮助LLM理解/写入重量空间的情况下,更现实世界的相关情景。
实验6
写入 Go 算法
我们现在测试Astra在150万参数尺度下编辑权重的能力,这个尺度太大了,无法直接适应其上下文。 Astra受命从零开始写出给定架构的高性能加权数(243 512 × 6 82),没有训练或网络访问。
这里,绳子给Astra一个Python沙盒,它可以读取并保存网络的重量分数(开始时均为0)和分析t
本文由 AI宝库自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
TL;DR
We find that frontier LLMs are surprisingly good at natively reading and writing neural network weights, well past what we’d expect from humans or conventional algorithms. This might be a big deal for both optimization and interpretability.
Just by looking at the raw weights, GPT-6 Astra can tell what a network was trained to do. And without any environment feedback, it has no trouble writing, from scratch, small game-playing networks that outplay networks trained with PPO for 100 million steps.
Likewise, asked to make Qwen3.5-0.8B better at math without gradients, Astra identifies an issue in its weights causing reasoning loops that Qwen’s own model card warns about, and fixes this by natively editing 0.016% of the weights. With the same sampling settings, this weight correction raises MATH-500 from 7.9% to 48.1% and generalizes out of the box to instruction following, raising IFEval by 3x.
All of this is possible without allowing Astra to write training loops. It uses its reasoning to figure out what each part of a neural network computes, or should compute, and changes the weights accordingly. We call this Weight-Space Programming.
Throughout the history of deep learning, we encoded our simplistic inductive biases into tiny symbolic optimizers like Adam or Muon. This is changing: our neural network weights will soon be natively optimized by LLMs that deliberately reason about their weights.
If you were asked to handcraft a neural network that plays Go, what would you do? If you were handed raw neural network weights and asked to predict their behavior, where would you even start? For almost any human, this is practically impossible.
Today, weights are written by optimization, by custom networks trained to write them, or by compilers from formal programs. In this post, we find that the current generation of frontier LLMs, used natively in natural language, are starting to become eerily good at understanding and crafting neural network weights around natural-language goals.
For a few years now, we’ve all been using LLMs to optimize text artifacts like prompts and the programs built around them . More recently, we’ve started using them to optimize whole harnesses and the training code and hyperparameters that train ML models .
We often justified these methods by reference to the fact that we don’t know other principled ways to hill-climb on text artifacts, unlike for updating the weights of differentiable neural networks. After all, humans can “optimize” code by hand, for example, so it made sense to ask LLMs to do it, but they can’t “optimize” neural weights by hand, so those remained largely in the realm of symbolic algorithms.
In this post, we share very early results that allow us to argue that the paradigm of reasoning-driven optimization is now coming even for differentiable neural networks.
In Weight-Space Programming, a general-purpose LLM reads and writes a network’s weights directly (i.e., not through an optimizer, and in particular not with gradient descent) around some natural language spec, sometimes even with no environment feedback at all.
In natural language, it’s becoming possible to “just ask” an LLM to natively find a hidden trait or failure inside the weights of a neural network, to fix that failure, or to write a new network from scratch. We report early, exciting results on each of these below, first on small networks and then even on real language models:
- LLMs can read neural network weights: In Experiments 1 to 3, we ask Astra questions like what game a network was trained to play, what shape is drawn by a diffusion model, and which language a small language model was trained on. In Experiment 7, we ask which of two language models was trained to be sycophantic.
- LLMs can fix neural network weights: In Experiment 4, we ask Astra to fix a network that’s failing at some physical control task. In Experiment 8, we ask it to make Qwen3.5-0.8B better at math, and its fix improves instruction following too.
- LLMs can write neural network weights from scratch: In Experiment 5, we ask Astra for networks that play three MinAtar games, and in Experiment 6, for a network that plays Go.
We start with a small-scale experiment to see if LLMs can understand the continuous weight space, which is essentially just a list of numbers.
In our first experiments, we train some neural network with some algorithm. It would be extremely exciting if the LLM is able to tell its behavior just from the weights.
Experiment 1
Can Astra tell which game the network was trained on just from the weights?
We trained neural network policies with PPO to play four computer games. All four networks take the same input channels, choose from the same actions, and have exactly the same network dimensions, so that it is not able to tell unless the weights are read.
For each of these networks, we pass its raw weights into Astra as a prompt, and ask: Which game was this neural network trained on? Without revealing the options of the games we consider, Astra was still able to name the right game for all four networks. This is exciting particularly because there are so many games out there that Astra could choose from.
It seems that Astra was able to work out what game each network was built to play, just from features of its weights. For example, where each input channel’s first-layer weights concentrate (e.g., for Breakout, the agent’s weights lie along the bottom row, a paddle), and which actions the output layer tells apart.
Experiment 2
Can Astra tell what the diffusion model will generate?
Next, we wanted to see if this generalizes to other tasks and models.
We train diffusion models (DDPM) to generate circle, triangle, and square images independently. We then ask Astra if it could tell what the DDPMs are trained to generate, just from the weights alone. We do not allow tool use or forward passes.
Astra was able to tell what each model generates, from the weights alone. It finds the shape in the output layer, where each hidden unit’s weights draw one piece of the shape’s edge, and it draws just those edges. Interestingly, it draws every shape as an outline, ignoring that the actual models generate filled shapes. This mistake kind of shows it does not rely on calculating the forward pass, but rather it actually reads the structure/geometry of the weights.
Experiment 3
Can Astra tell what a language model learned, from the middle of the network alone?
Now, in the first two experiments above, Astra was not really looking at the full network and could get away with only reading the first or the last layers. This is not a scalable strategy for larger (particularly language) models and problems we really care about, as how they process and think through their input often happens in the intermediate layers. So next, we take the first and last layers away and leave Astra with only the middle layers.
We train three small language models (7.2M parameters) to predict the next character, one each on Python codeThe Python code dataset, as a list of its files with a script that rebuilds it: GitHub., Japanese in alphabet (romaji) , and English . We then remove the input and output layers and give Astra only the four transformer blocks in between. Without these two layers, nothing in the weights says which character is which, and the model cannot be run on any text. Astra may analyze the weights with Python, but it may not run the network or any of its layers on any input.
We ask: which language was this network trained on, and what each of its 24 attention heads does. Astra names the right language for all three networks, in both of its attempts. It also finds every copying head (induction head), the heads that let a model repeat text it has seen earlier, and names no other head as one.
The reasoning went like this. To tell Python apart, Astra looked for copying heads, which let a model repeat earlier text, such as completing tot to total when total came before. Without running anything, it found a first-layer head that looks one character back and then, by multiplying weight matrices, the later heads that search using what that head brings along (Figure 1). We find that this is actually a method presented by Elhage et al. , which we never mentioned to Astra. Code repeats names far more than prose, so many copying heads pointed to Python.
Romaji stood out instead because the last of the four blocks it was given (not the output layer, which was removed) writes in fewer distinct directions, as if the model had fewer letters to tell apart. Indeed, romaji never uses some letters like q, l, v and x.
So far, Astra has only read weights. Now, we ask if Astra knows how to write the weights.
Experiment 4
Can Astra fix a failing network by editing its weights?
We train a PPO network to operate a car such that it can scale a ramp in a Kinetix environment . To do so, it needs to reverse the car for some distance, such that it has enough runway to accelerate long enough to overcome the ramp. However, the PPO network converges to a local-minimum policy where it drives straight at the ramp and gets stuck.
We give GPT-6 Astra the weights, a description of the scene and one recorded episode, and ask it to explain why the network fails, then fix it by writing new weights. In a single try with no tools, Astra’s edit makes the car succeed in all 1,024 episodes, changing 3.5% of the weights.
From the environment context and the PPO network’s trajectory, Astra identifies that the network has converged to a local minimum. Through minimal edits to the weights, Astra changes the policy to back up the car before driving forward at full speed. Astra’s reasoning shows how: it adds a small separate path through a few units per layer that reads the car’s position and speed, and once the green wheel is past the red strip, the path switches off and the trained network drives the rest.
Experiment 5
Can the LLM write weights from scratch?
Now let's see if Astra can write a neural network from scratch in zero-shot.
We take three MinAtar games : Breakout, Seaquest and Asterix. For each of them, we provide Astra the game rules and source code, and the corresponding network. There is no access to data, loss, gradients, and tools. We also do not allow Astra to roll out the network in the environment. With just the network weights and environment description, Astra generates the new weights in text directly, after which we evaluate the new network.
Astra’s generated networks beat PPO trained for 100 million steps in all three games. Against PPO trained for 500 million steps, they score 20 times as much in Breakout, come close in Asterix, and reach 60% of its score in Seaquest.
How does it do it: Astra reasons about the desired programs it wants each network to implement and converts them into neural form. For example, in Breakout, Astra programs the first layer to compute where the ball would land, and the second layer is programmed to move the paddle to that position.
So far, most networks we have examined have weights that fit into Astra’s context directly, and we have not enabled tool use. Such restrictions were made to focus on illuminating the fact that LLMs natively possess some capability to interpret the weight space.
From here on out, we seek to push the capabilities of Weight-Space Programming and consider more real-world-relevant scenarios where the networks do not fit within context and where tools can assist the LLM's understanding/writability of the weight space.
Experiment 6
Writing a Go algorithm
We now test Astra’s capability to edit weights at the 1.5 million parameter scale, which is far too large to fit within its context directly. Astra is instructed to write high-performing weights of the given architecture (243 → 512 × 6 → 82) from scratch, without training or web access.
Here, the harness gives Astra a Python sandbox, where it can read and save the network’s weight tensors (all zero at the start) and analyze t
Auto-fetched and translated by AI Gem Box. All rights belong to the original author.