Astra can read and write weights to improve Qwen
本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。
Astra can read and write weights to improve Qwen
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.
仅通过观察原始权重,GPT-6 Astra 就能判断出一个网络被训练用来做什么。而且在没有任何环境反馈的情况下,它能够毫无困难地从零开始编写小型游戏网络,其表现甚至超过了经过 PPO 训练一亿步的网络。
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.
同样,当被要求在不使用梯度的情况下提高 Qwen3.5-0.8B 的数学能力时,Astra 识别出了其权重中导致推理循环的问题(Qwen 自身的模型卡片对此有警告),并通过原生编辑 0.016% 的权重解决了这个问题。在相同的采样设置下,这种权重修正将 MATH-500 的得分从 7.9% 提高到了 48.1%,并能直接推广到指令遵循任务,使 IFEval 得分提高了 3 倍。
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.
所有这一切的实现都不需要允许 Astra 编写训练循环。它利用自身的推理能力来弄清楚神经网络的每个部分计算了什么,或者应该计算什么,并相应地更改权重。我们将此称为“权重空间编程”(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.
在深度学习的历史中,我们将简化的归纳偏置编码进 Adam 或 Muon 等微小的符号优化器中。这种情况正在改变:我们的神经网络权重很快将由能够刻意推理权重的 LLM 进行原生优化。
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:
在自然语言中,现在已经可以“直接要求”大语言模型原生查找神经网络权重中隐藏的特征或故障、修复该故障,或者从零开始编写一个新网络。我们在下面报告了关于这些方面的早期且令人兴奋的结果,首先是在小型网络上,然后甚至是在真实语言模型上:
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.
在我们的初步实验中,我们用某种算法训练了一些神经网络。如果大语言模型仅凭权重就能判断出其行为,那将是非常令人兴奋的。
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.
我们使用 PPO 训练了神经网络策略来玩四款电脑游戏。所有四个网络都采用相同的输入通道,从相同的动作中进行选择,并且具有完全相同的网络维度,因此如果不读取权重,是无法区分它们的。
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.
对于这些网络中的每一个,我们将其原始权重作为提示词输入给 Astra,并询问:这个神经网络是针对哪款游戏训练的?在不透露我们所考虑的游戏选项的情况下,Astra 仍然能够为所有四个网络说出正确的游戏名称。这尤其令人兴奋,因为市面上有太多的游戏可供 Astra 选择。
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.
看来 Astra 仅从权重的特征就能推断出每个网络是为玩什么游戏而构建的。例如,每个输入通道的第一层权重集中在哪里(例如,对于《打砖块》,代理的权重位于底行,即挡板),以及输出层区分了哪些动作。
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.
我们训练扩散模型 (DDPM) 分别生成圆形、三角形和正方形图像。然后我们询问 Astra,仅凭权重,它是否能判断出这些 DDPM 是为了生成什么而训练的。我们不允许使用工具或进行前向传播。
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.
Astra 仅凭权重就能判断出每个模型生成的内容。它在输出层找到了形状,其中每个隐藏单元的权重绘制了形状边缘的一部分,并且它只绘制了这些边缘。有趣的是,它将每个形状都绘制为轮廓,忽略了实际模型生成的是实心形状。这个错误在某种程度上表明它并不依赖于计算前向传播,而是实际上读取了权重的结构/几何形状。
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.
在上述前两个实验中,Astra 并没有真正查看完整的网络,仅通过读取第一层或最后一层就能完成任务。对于我们真正关心的更大规模(特别是语言)模型和问题,这不是一种可扩展的策略,因为它们处理和思考输入的方式通常发生在中间层。因此,接下来我们移除了第一层和最后一层,只留给 Astra 中间层。
We train three small language models (7.2M parameters) to pred
我们训练了三个小型语言模型(720 万参数)来预测