Paper: 2611.27607 — Tasklets: A Unit-Test Benchmark for Language Model Architectures
Authors: Zayd Muhammad Kawakibi Zuhri, Munachiso Samuel Nwadike, Kentaro Inui, Alham Fikri Aji
Categories: cs.CL, cs.LG
Reading scope: Original arXiv v1 HTML main text and Appendix A. Tables and both figures were inspected, including the original Figure 1 SVG and Figure 2 heatmap. Figure labels are rounded as displayed. The experiments were not reproduced.
The Problem
Suppose you are choosing the part of a language model that carries information from earlier tokens to the current position: its sequence-mixing layer. In one of the paper’s examples, the input supplies associations such as 4 → 7 and 3 → 8. Later, a query for 4 should produce 7. A layer that learns this lookup looks promising for retaining facts from a context (§3.1.1).
Now ask it to maintain a running total, keeping only the last digit. Inputs 2, 7, 5 should produce successive states 2, 9, 4. This is the paper’s modular-addition example. The model must update a state as new inputs arrive; finding a stored association answers a different computational question (§3.7.1). These are illustrative task examples from the source, rather than experiments rerun here.
Zuhri and colleagues want architecture researchers to check these distinctions before expensive larger-model experiments. Earlier studies already use synthetic tests, but task names, variants and settings differ. Tasklets organizes them into a shared benchmark so that a good result on one operation can be assessed alongside other operations (§§1–2).
The Explanation
Give each computational claim a defined test
Tasklets gathers 16 existing synthetic tasks into seven capability groups. The contribution is the shared task collection and evaluation setup, with an accompanying comparison of layer implementations (§§2–3).
| Capability | Tasks | What the test asks |
|---|---|---|
| Recall | 3 | Retrieve current-context associations, including noise and multi-token keys |
| Copying | 3 | Reproduce a sequence, reverse it, or filter distractors |
| Memorization | 1 | Retrieve a fixed mapping learned during training |
| Counting | 2 | Count queried symbols and sort symbols by frequency |
| Stacks | 2 | Follow push/pop instructions for one or four independent stacks |
| Formal languages | 3 | Check nested brackets and equal-length letter blocks, or follow write/ignore/read rules |
| State tracking | 2 | Maintain a running total or compose successive rearrangements |
The distinction between recall and memorization is especially useful. In recall, the association comes from the current input and can change in another input. In memorization, the mapping stays fixed and is learned during training. A model can therefore do well on the fixed mapping while struggling to retrieve newly supplied associations (§§3.1.3 and 3.3).
Each task has 100,000 generated training examples and 3,000 test examples, using a vocabulary of 292 tokens. These are deliberately small symbolic problems, with defined input formats and target positions (§3).
Compare trained implementations within a bounded setup
The study evaluates 24 architectures across five families. Attention reads from earlier token representations; recurrent layers carry a memory state forward. The tested recurrent designs include updates that revise key-value memories, updates that scale individual memory coordinates, and nonlinear updates such as those in LSTM and GRU. Hybrid designs combine mechanisms (§4.1).
The models contain roughly 144,000–214,000 parameters, according to the actual configuration table. They use two or four blocks, with architecture-specific memory sizes and other settings. Each architecture-task combination is trained at three learning rates; the run with the lowest validation loss is then evaluated on the test set (§4.2; Appendix A, Tables 1–3).
The authors report about seven minutes per run on one RTX 4090. The complete grid contains 1,152 runs, from 24 architectures × 16 tasks × three rates, totaling approximately 134 GPU-hours. Those are reported training costs, rather than compute performed for this article (§4.2).
Read the crossover between lookup and state updates
The table below reproduces the rounded labels in Figure 2, on its 0–1 accuracy scale. These three tasks use whole-example exact match: every nonmasked target in a test sequence must be correct. The Transformer configuration has two blocks; LSTM and GRU have four (Appendix A, Table 2).
| Task | Transformer | LSTM | GRU |
|---|---|---|---|
| Multi-query recall | 1 | 0 | 0 |
| Running sum modulo 10 | 0.01 | 1 | 1 |
| Composition of permutations | 0 | 1 | 0.77 |
The trained Transformer retrieves associations very well, while the tested LSTM shows the opposite strengths: weak recall and strong running-state results. The permutation task requires composing rearrangements of five positions, where instruction order matters. GRU’s displayed 0.77 on this task also shows variation within the nonlinear recurrent family (§3.7; Figure 2).
A whole-example score needs careful reading. The Transformer’s rounded 0.01 on modular addition means about one percent of complete test sequences pass. A single incorrect state can make an entire sequence fail; this number leaves the accuracy of individual intermediate states unspecified (§4.2).
The summary chart counts 11 solved tasks for the Transformer and seven for LSTM, using an accuracy threshold of at least 0.9. That aggregate favors the Transformer, while the running-state profile favors LSTM. The choice depends on which computations matter to the workload (Figure 1).
Use the remaining tasks to locate the difficulty
Almost all tested architectures do well on the fixed-mapping memorization task, which the authors describe as a useful sanity check. Meanwhile, counting and frequency sorting remain difficult across the tested designs. Most perform well on single-stack operations, with more variation on multiple stacks (§5).
Those differences help explain the benchmark’s value. Recalling a supplied fact, learning a fixed association, counting occurrences and updating a running state each impose a particular demand. Keeping the variants together makes it easier to see where a trained implementation succeeds and where its performance falls away.
Core Concepts
Where the answer comes from. A memorized mapping comes from training; a recall answer comes from the current context. Keeping both tests prevents one source of information from standing in for the other.
Retaining information and updating it. The lookup example needs associations available for later queries. The running-total example needs each input to change the state correctly. These demands can produce different architecture rankings.
The unit of accuracy. A score may measure fully correct sequences or correct target tokens. Within a task, the architectures share that scoring rule; comparisons across tasks require retaining the rule with the number.
The Insight
An architecture needs a capability profile tied to its intended workload. Tasklets gives researchers a common way to separate elementary computations that a single recall score or overall task count can blend together. Its strongest lesson is the distinction exposed by the small-model tests, with the experimental conditions kept visible.
A Critical Reading
These results describe particular trained implementations. Configurations differ in depth, memory shape and components, even under the shared protocol. The listed setup uses random seed 42, and its three runs per task are learning-rate choices. A failure within this configuration and training budget does not establish that every version of an architectural family is unable to perform the computation (§4.2; Appendix A).
Scoring also varies by task. Most use whole-example exact match; memorization, stack operations and flip-flop instead average accuracy over individual nonmasked tokens. The summary’s 0.9 threshold consequently combines different units. Per-task comparisons preserve the scoring context more clearly than the total number of solved tasks (§4.2; Figure 1).
Finally, the tests use synthetic symbolic inputs in the described formats and length settings. Evaluation obtains predictions in one forward pass over each supplied sample, rather than rolling out an autoregressive answer. The results do not establish natural-language quality, longer-context performance or behavior at the scale of deployed language models. Those require additional evaluation (§§3–4; Appendix A).
What You Can Use
Before a larger training run, test a proposed sequence layer on the operations the intended workload needs, keeping task variants, model configuration, training budget and accuracy unit with the results. For the lookup example, check whether new input associations remain accessible. For the running-total example, check whether successive updates remain correct. Tasklets supplies a shared starting point for those checks; the next step is to validate the selected design in the full model and workload.
论文:2611.27607 — Tasklets: A Unit-Test Benchmark for Language Model Architectures
作者:Zayd Muhammad Kawakibi Zuhri、Munachiso Samuel Nwadike、Kentaro Inui、Alham Fikri Aji
分类:cs.CL、cs.LG
阅读范围:阅读 arXiv v1 原始 HTML 正文与附录 A,查看了表格及两幅图,包括图 1 的原始 SVG 和图 2 的热力图。
图中数值按显示的舍入值读取;未复现实验。
问题
设想你在选语言模型里的一种部件:把过去词元的信息送到当前位置的「序列混合层」。 论文的一个例子在输入中给出 4 → 7、3 → 8 等对应关系,后来问 4,就应该答 7。 能学会查这张表的层,看起来很适合保留上下文里的事实,见第 3.1.1 节。
现在换一道题:持续加总输入,只保留个位。 输入 2、7、5,沿途状态应该是 2、9、4。 这是论文的模十加法例子。 它要求新输入不断正确改变状态,与找回已经给出的关系,是不同的计算问题,见第 3.7.1 节。 这些是原文解释任务的例子,不是这里重新跑出的实验。
Zuhri 等人希望架构研究者在投入更昂贵的大模型实验前,就能检查这些差别。 前人的论文已经使用合成小题,但名称、变体和设置常不相同。 Tasklets 把它们整理进一套共同基准,让某一种操作上的好成绩能与其他操作一起看,见第 1—2 节。
翻译
给每个计算主张一项定义清楚的测试
Tasklets 收集 16 项已有合成任务,分成七组能力。 贡献是共同的任务集合与评价设置,以及对层实现的比较,见第 2—3 节。
| 能力 | 任务数 | 要检查什么 |
|---|---|---|
| 上下文检索 | 3 | 找回当前对应关系,包括噪声与多词元键 |
| 复制 | 3 | 原样复制、倒序复制,或过滤干扰后复制 |
| 记忆固定映射 | 1 | 找回训练时学会的固定对应关系 |
| 计数 | 2 | 计数被查询符号,再按出现频率排序 |
| 栈操作 | 2 | 在一个或四个独立栈中按指令压入、弹出 |
| 形式语言 | 3 | 检查括号正确嵌套、等长字母段,或遵循写入、忽略、读取规则 |
| 状态追踪 | 2 | 保持累计值,或组合连续的重排操作 |
检索与固定映射的差别尤其有用。 检索的答案来自当前输入,换一段输入,对应值可以变;固定映射则在训练中学好,之后保持不变。 所以,一个模型可以很会记固定表,却不擅长找回刚给出的上下文关系,见第 3.1.3、3.3 节。
每项任务生成 十万条训练样本、三千条测试样本,词表有 292 个词元。 这些刻意缩小的符号题,有明确的输入格式和需要预测的位置,见第 3 节。
在有边界的设置里,比较训练后的实现
研究比较 五个家族的 24 种架构。 注意力从先前词元的表示里读取信息;循环层则把记忆状态往后传。 被测循环设计包括修正键值记忆的更新、分别缩放记忆坐标的更新,以及 LSTM、GRU 这样的非线性更新;混合架构会组合不同机制,见第 4.1 节。
按实际配置表,模型约有 14.4 万至 21.4 万参数。 它们用两层或四层计算块,记忆大小和其他细节因架构而异。 每个架构与任务的组合试三种学习率,再取验证损失最低的那次,到测试集上评价,见第 4.2 节及附录 A 的表 1—3。
作者报告,在一张 RTX 4090 上,单次训练约 七分钟。 完整网格是 24 种架构 × 16 项任务 × 三种学习率,共 1,152 次训练,约 134 GPU 小时。 这是论文报告的训练成本,不是生成这篇文章所做的计算,见第 4.2 节。
看清查表与更新状态的强弱交叉
下表保留图 2 的舍入标签,使用 0—1 的准确率尺度。 这三项任务都按整条样本是否完全正确计分:所有未屏蔽的目标位置都要答对。 Transformer 配置是两个计算块,LSTM 与 GRU 是四个,见附录 A 表 2。
| 任务 | Transformer | LSTM | GRU |
|---|---|---|---|
| 多查询上下文检索 | 1 | 0 | 0 |
| 模十累计加法 | 0.01 | 1 | 1 |
| 连续置换的组合 | 0 | 1 | 0.77 |
训练后的 Transformer 很会找回对应关系,所测 LSTM 则呈现相反强项:检索弱,连续状态更新强。 置换题要求不断组合五个位置的重排,指令顺序会影响结果。 GRU 在这题的显示分数是 0.77,也说明同属非线性循环家族,成绩仍有差别,见第 3.7 节及图 2。
整条样本分数要仔细读。 Transformer 在模十加法上的舍入值 0.01,表示约百分之一的完整测试序列通过。 只要一个中间状态错了,整条序列就会判错;这个数本身没有交代各个中间状态的准确率,见第 4.2 节。
汇总图按准确率至少 0.9 算过关,Transformer 通过 十一项,LSTM 通过 七项。 总数偏向 Transformer,连续状态题的能力分布却偏向 LSTM。 该怎样选,要看实际任务需要哪种计算,见图 1。
用其他小题定位困难
几乎所有被测架构都能做好固定映射记忆,作者把它当成检查基本学习是否正常的小题。 计数与频率排序则普遍较难。 多数架构能做好单栈操作,多栈的成绩差异更大,见第 5 节。
这些差别说明了整套基准的用途。 找回刚给的事实、学固定关系、统计次数,以及更新累计状态,各自提出一种要求。 把变体放在一起,才能更容易看见训练后的实现在哪里成功,又在哪里掉下去。
核心概念
答案从哪里来。 固定映射来自训练,上下文检索来自当前输入。 两项都保留,才能防止一种信息来源代替另一种接受检验。
保留信息与更新信息。 查表题要求对应关系留到查询时还可用;累计题要求每个输入都正确改变状态。 两种要求会排出不同的架构顺序。
准确率的单位。 分数可以量完全正确的序列,也可以量答对的目标词元。 同一道题的架构共用计分规则;跨题比较,要把规则连着数字一起保留。
洞见
架构需要一份对应实际工作负载的能力分布。 Tasklets 用共同设置,把一个检索分数或过关总数容易揉在一起的基本计算拆开。 最有用的判断,是小模型测试显出的差别,以及始终随结果保留的实验条件。
博导审稿
这些结果描述的是特定训练实现。 即使使用共同协议,深度、记忆形状和组成部件仍有差别。 列出的设置采用随机种子 42,每项任务的三次训练是学习率选择。 某种配置在这份预算里失败,不能证明该架构家族的所有版本都无法完成这种计算,见第 4.2 节及附录 A。
任务计分也不完全同单位。 多数按整条样本完全正确计算;固定映射记忆、栈操作和读写切换任务,则按未屏蔽的目标词元计算平均准确率。 汇总图的 0.9 门槛,因此合并了不同单位。 逐题比较,比只看过关总数更容易保留计分语境,见第 4.2 节及图 1。
最后,测试采用指定格式与长度设置下的合成符号输入。 评价对每条给定样本做一次前向计算,得到各位置的预测,没有逐步生成并接回自回归答案。 结果还不能确定自然语言质量、更长上下文表现,或实际部署规模模型的行为。 这些需要追加评价,见第 3—4 节及附录 A。
启发
准备投入更大的训练前,可以先用目标工作需要的操作测新序列层,把任务变体、模型配置、训练预算和计分单位连着成绩一起保存。 查表例子里,检查新输入的对应关系是否仍可找回;累计例子里,检查连续更新是否保持正确。 Tasklets 给这些检查提供了共同起点,下一步还要在完整模型与真实工作负载里验证选定设计。