上一篇只测了七个"建个文件跑一下"的小任务,题目太浅,测不出东西。这一篇换了更接近现在主流智能体评测的做法:十二项编码任务(修测试、按规格实现、拆包重构、CLI、SQL、git 提交、并发……)、八项日常杂活(整理文件、洗表格、票据转 JSON、会议纪要、邮件回复、周报、预算表)、外加十六道单轮题,把两个 1.7B 模型和四个智能体工具放在同一套尺子下面量。
先说结论:
- 在这个尺寸上,工具比模型重要。 同样是 LFM3-1.7B,最好的组合(OpenLaoKe)12 项里过 11 项,最差的(OpenCode)0 项。同一个模型换了壳,结果差 11 项。
- Spark-1.7B 和 LFM3-1.7B 总量打平(19 对 20,各 48 次),但强项完全不同。 单轮 16 题是 5 对 12,LFM3 的算术和推理明显更稳;编码任务里两边各有一个高分组合(Jcode + Spark 7/12、OpenLaoKe + LFM3 11/12),换个壳就换个人赢。
- 日常任务比编码任务更难,不是更容易。 十二项编码 39/96,八项目常 17/64(端到端口径,第二次跑)。越是要"按精确格式产出"的活,1.7B 越容易差一点。
- 小模型最大的浪费不是不会做,而是不会停。 LFM3 有大量"产物做对了,但 120 秒还没退出"的记录——见"失败解剖"。
- 这个尺寸的单次跑分根本不可复现。 同一模型同一套日常题跑两次,Spark 从 16/32 掉到 6/32、LFM3 从 8/32 涨到 11/32。任何"谁几比几"都别当结论背,详见"这套分数能不能复现"。
- OpenCode 在这个尺寸上基本不可用。 Spark 1/12、LFM3 0/12,几乎全部撞超时,连 merge 都过不了(唯一那分是蒙对的 SQL);八项目常更是两模型全灭。
谁在比赛
| 项 | 设置 |
|---|---|
| 模型 | LFM3-1.7B(Q4_K_M)、Spark-X2.5-1.7B(Q4_K_M) |
| 推理栈 | llama.cpp 1.0.0(build b12359),--jinja --reasoning off,temp 0.1 |
| 机器 | MacBook Air M4 16G |
| 工具 | OpenLaoKe、pi、Jcode、OpenCode |
| 每格预算 | 120 秒墙钟、25 步,thinking 全关,一格只跑一次 |
| 判分 | 只看文件系统:执行文件、打开文档、比对内容、看 git 状态。不采信模型自述 |
测试集怎么设计的,以及为什么它可信
三块题:
| 块 | 数量 | 内容 | 判分 |
|---|---|---|---|
| 编码 | 12 | merge、download(两个锚点)、修测试、按规格实现、拆包重构、命令行工具、JSON→CSV、写 SQL、日志抽取、git 提交、Word 表格、并发 | 跑测试 / 执行文件 / 打开产物 / 对比精确内容 |
| 日常 | 8 | 整理笔记、清洗表格、票据转 JSON、会议纪要、笔记索引、邮件回复、周报汇总、预算表(提示词全中文) | 文件名、CSV 行、JSON 字段、xlsx 求和、Markdown 表顺序 |
| 单轮 | 16 | 算术 5、读代码 4、写代码 3、指令 2、数据格式 2 | 人工逐题判最终答案 |
编码和日常这两块里,每一项都写了三样东西:种子文件、参考解、验证器。跑分前先跑 --selftest,要求"参考解必须过、空目录必须不过",12/12 和 8/8 都过才允许开跑。这一步不是形式主义:洗表格那一项最初就因为种子数据里 bob / Bob 大小写没对齐,参考解自己都过不了,被判了出来。
另外两条纪律:
- 每个组合一个独立目录,种子文件由脚本铺好。曾经出现过平铺目录被后一个智能体搜索到、直接抄了上一个组合答案的情况(Jcode 干过一次),所以现在每个 run 都套在自己的父目录里。
- 一次一格。 1.7B 在这个温度下也会抖动,同题两次结果不同。我们只在日常任务上跑了两次作对照,发现"抖动"这个词把问题说得太轻了——详见"这套分数能不能复现"那一节。
编码任务:12 项
Spark-1.7B(单元格 = 结果 + 墙钟秒数)
| 任务 | OpenLaoKe | pi | Jcode | OpenCode |
|---|---|---|---|---|
| merge | ✅21s | ✅19s | ✅23s | ❌111s |
| download | ✅17s | ✅12s | ✅21s | ❌109s |
| 修测试 | ✅43s | ✅36s | ✅41s | ⏱120s |
| 按规格实现 | ❌46s | ❌59s | ⏱120s | ⏱120s |
| 拆包重构 | ⏱120s | ✅36s | ⏱120s | ⏱120s |
| 命令行工具 | ❌44s | ⏱120s | ❌44s | ⏱120s |
| JSON→CSV | ✅14s | ⏱120s | ❌15s | ❌113s |
| 写 SQL | ❌21s | ⏱120s | ✅32s | ✅117s |
| 日志抽取 | ❌8s | ⏱120s | ✅47s | ❌109s |
| git 提交 | ⏱120s | ✅20s | ✅29s | ⏱120s |
| Word 表格 | ✅30s | ✅39s | ✅58s | ⏱120s |
| 并发 | ❌23s | ❌45s | ⏱120s | ⏱120s |
LFM3-1.7B(单元格 = 结果 + 墙钟秒数)
| 任务 | OpenLaoKe | pi | Jcode | OpenCode |
|---|---|---|---|---|
| merge | ✅31s | ⏱120s | ✅22s | ⏱120s |
| download | ✅28s | ✅57s | ✅14s | ⏱120s |
| 修测试 | ✅65s | ⏱120s | ✅47s | ⏱120s |
| 按规格实现 | ✅54s | ⏱120s | ⏱120s | ⏱120s |
| 拆包重构 | ✅71s | ⏱120s | ⏱120s | ⏱120s |
| 命令行工具 | ✅52s | ⏱120s | ✅44s | ⏱120s |
| JSON→CSV | ✅34s | ⏱120s | ✅52s | ⏱120s |
| 写 SQL | ❌57s | ⏱120s | ❌35s | ⏱120s |
| 日志抽取 | ✅28s | ⏱120s | ✅69s | ⏱120s |
| git 提交 | ✅23s | ✅57s | ⏱120s | ❌91s |
| Word 表格 | ✅49s | ✅90s | ⏱120s | ⏱120s |
| 并发 | ✅52s | ❌70s | ❌17s | ⏱120s |
按组合汇总:
| 组合 | 通过 | 通过项平均耗时 | 失败形态(超时/没产出/产出不对) |
|---|---|---|---|
| OpenLaoKe + LFM3-1.7B | 11/12 | 44.3s | 0 / 1 / 0 |
| Jcode + Spark-1.7B | 7/12 | 36.0s | 3 / 0 / 2 |
| pi + Spark-1.7B | 6/12 | 27.0s | 4 / 1 / 1 |
| Jcode + LFM3-1.7B | 6/12 | 41.4s | 4 / 1 / 1 |
| OpenLaoKe + Spark-1.7B | 5/12 | 24.9s | 2 / 2 / 3 |
| pi + LFM3-1.7B | 3/12 | 68.2s | 8 / 0 / 1 |
| OpenCode + Spark-1.7B | 1/12 | 117.2s | 7 / 4 / 0 |
| OpenCode + LFM3-1.7B | 0/12 | - | 11 / 0 / 1 |
- Spark-1.7B:19/48
- LFM3-1.7B:20/48


一眼能看出几件事:
- OpenLaoKe + LFM3 11/12,唯一没过的是写 SQL。它对小模型做了针对性处理(工具调用格式容错、强制"写完要真跑一遍"、权限门不打断),在这套题上几乎满清。
- pi + LFM3 只有 3/12,同样是 LFM3,换了壳就掉 8 项——而且失败多是 120 秒超时,不是答案错。
- OpenCode 两个模型 1/12 和 0/12。它给 2B 模型的系统提示和工具 schema 太重,光读上下文就耗尽预算。
- 两个锚点(merge、download) 除了 OpenCode 全过,说明工具链本身是通的,后面的失败都是真失败。
日常任务:8 项
八项杂活,提示词全中文(整理笔记、洗表格、票据转 JSON、会议纪要、笔记索引、邮件回复、周报汇总、预算表)。下表是跑了两次里第二次(完整且带产物核验的那次)的逐格结果。✅ 后面是秒数;⚠️产 表示文件内容全对但进程超时被杀(产物可用、交付不合格);❌ 是没做对;⏱ 是全程超时没产物。
| 任务 | LFM3 OpenLaoKe | LFM3 pi | LFM3 Jcode | LFM3 OpenCode | Spark OpenLaoKe | Spark pi | Spark Jcode | Spark OpenCode |
|---|---|---|---|---|---|---|---|---|
| 整理笔记 | ⏱ | ✅80 | ⏱ | ⏱ | ❌20 | ❌26 | ⏱ | ⏱ |
| 清洗表格 | ⏱ | ⏱ | ⏱ | ⏱ | ❌22 | ❌36 | ⏱ | ⏱ |
| 票据转 JSON | ✅43 | ✅66 | ✅33 | ⏱ | ✅24 | ✅20 | ✅22 | ⏱ |
| 会议纪要 | ✅27 | ✅60 | ✅22 | ⏱ | ❌15 | ❌8 | ❌10 | ⏱ |
| 笔记索引 | ❌46 | ⏱ | ❌92 | ⏱ | ❌30 | ✅53 | ❌29 | ⏱ |
| 邮件回复 | ❌40 | ✅65 | ✅39 | ⏱ | ❌19 | ✅29 | ❌26 | ⏱ |
| 周报汇总 | ❌48 | ⏱ | ✅88 | ⏱ | ❌15 | ⏱ | ❌29 | ⏱ |
| 预算表 | ✅71 | ⚠️产120 | ❌68 | ⏱ | ❌92 | ⏱ | ✅117 | ⏱ |
按工具合计(8 项):
| OpenLaoKe | pi | Jcode | OpenCode | 合计 | |
|---|---|---|---|---|---|
| LFM3-1.7B | 3/8 | 4/8 | 4/8 | 0/8 | 11/32 |
| Spark-1.7B | 1/8 | 3/8 | 2/8 | 0/8 | 6/32 |
两个口径要分开看:端到端按时交付(上表,超时就算没过)和 产物正确(文件存在且内容全对,不管是否超时退出)。LFM3 端到端 11、产物正确 12(pi 的预算表内容对但超时被杀);Spark 两个口径都是 6。也就是说 LFM3 在杂活上"会做但收不了工"的情况比 Spark 多,而 Spark 是更多"根本没做对"。
OpenCode 八个日常格 两个模型全超时,一个都没跑出来——这个尺寸加这套工具链基本进不了实战。
这套分数能不能复现:不能,而且差得离谱
这一节是这次最该说的话,比任何一次跑分都重要。
八项目常我用两个模型各跑了两次,中间只改了脚本里记录"产物正确"这一列、没动任何提示词和模型。结果:
| 模型 | 第一次 | 第二次 |
|---|---|---|
| LFM3-1.7B | 8/32 | 11/32 |
| Spark-1.7B | 16/32 | 6/32 |
Spark 从 16 掉到 6,LFM3 从 8 涨到 11。同一个模型、同一套题、同一台机器,总分能差出 10 分,而且两个模型往相反方向动。 这不是一两个格子抖,而是整行分数都在漂。
这说明前一篇里"Jcode + Spark 7/7"这类高分格子,和这一篇任何单次的"谁几比几",都高度不可复现。2B 以下的小模型在多轮工具调用里,每一步都在抛硬币,连乘八步之后,一次跑分基本等于抽样噪声,而不是模型的"真实水平"。
所以这篇给的所有单格数字,只描述那一次,不要当结论背。真要排名次,每格至少跑 3 到 5 次取中位数、报方差;我们这套预算(一格一次)做不到,宁可把"测不准"这件事本身当成结论。能站得住的只有两种结论:一是 OpenCode 全灭 这种远超噪声的压倒性失败,二是"产物对了却没停"这种成形态反复出现的结构性问题,不是某一格的分数。
单轮能力:16 题
十道变十六道,分成五组,全部人工逐题判最终答案(不使用字符串匹配,上一篇已经踩过"100 分钟被判对"的坑)。
| 组 | Spark-1.7B | LFM3-1.7B |
|---|---|---|
| 算术(5) | 0/5 | 5/5 |
| 读代码(4) | 1/4 | 2/4 |
| 写代码(3) | 2/3 | 2/3 |
| 指令(2) | 0/2 | 1/2 |
| 数据格式(2) | 2/2 | 2/2 |
| 合计 | 5/16 | 12/16 |
最刺眼的差距在算术:Spark 五道全错(40 元涨 25% 再降 20% 答 30;30% 是 45 求 10% 答 35;数列 2,6,12,20,30 下一项答 22;150 公里 2.5 小时答 30 km/h;40 人里 60% 女生、女生四分之一戴眼镜答 12 人)。LFM3 五道全对,而且过程写得很清楚。
读代码两边都一般:给 s[1:4][::-1] 求值,两个都答错(一个 abc、一个 edcba)。给默认参数 b=[] 那道,LFM3 把机制解释得完全正确,但没按要求写出 exact output,判错。
指令组最能看出"听话"程度:要求"三行、每行一个颜色词",Spark 给了三行 -,LFM3 给了 red/green/blue;要求"写一句关于海的话且不含字母 e",Spark 答了一个单词 Fish,LFM3 写了一整句但里面有 e。
逐题证据和模型原始回答都在文末附录。
速度
同一台机器、同一批服务器,bench/speed_probe.py,各跑三次取中位数:
| prefill (tok/s) | decode (tok/s) | |
|---|---|---|
| LFM3-1.7B Q4 | 207 | 35.4 |
| Spark-1.7B Q4 | 73 | 35.3 |
decode 打平,prefill 差近三倍。但这次 prefill 的优势没有换来更快的任务完成:编码任务里 LFM3 的最好组合平均 44 秒,Spark 的最好组合 36 秒。原因还是"不会停"——LFM3 每轮想得更多,收工更慢,光快在第一步没用。
失败解剖
把 96 + 64 次失败按形态分开,结论就清楚了。
| 形态 | 长什么样 | 谁身上最多 |
|---|---|---|
| 不会做 | 文件没生成,或生成的是错的 | Spark 的算术类、OpenCode 全体 |
| 会做但交不出来 | 产物正确,格式差一点(少个字段、排序不对) | 两边都有,Spark 偏多 |
| 会做但不会停 | 产物已经写对,进程 120 秒还没退出 | LFM3 最典型 |
| 工具链吃掉 | 权限门、参数解析、上下文过重 | OpenCode;修复前的 OpenLaoKe |
第二种和第三种最值得说。
"会做但交不出来":Spark 在清洗表格那项把空格和大小写都处理对了,但没去重、也没排序;在周报那项算出了三个商品的金额,总计写成了 32(正确 51)。它不是不会读表,是收尾时漏了一步。
"会做但不会停":LFM3 在整理笔记那项把五个文件名全按 日期-标题.md 改好了,然后继续折腾到 120 秒被杀;在笔记索引那项表格也生成了,只是顺序反了(从旧到新),同样没退出。这类格子如果只看产物,是能用的;如果看"交付",是不合格的。所以日常任务那张表给了两个口径:产物正确 和 按时交付。
这也解释了为什么编码任务里 LFM3 的总量并没有输:编码任务多半有测试或脚本兜底,跑一下就结束;日常任务的"完成"标准是隐式的,小模型不知道该在哪停。
日常任务这一轮里,这种形态尤其明显:LFM3 在 pi 下的预算表把三个分类金额和总计全算对了,进程却拖到 120 秒被杀,产物可用、端到端不算交付;整理笔记、笔记索引、清洗表格都有"改对了名字但没退出"的记录。而 Spark 的失败更多是第一种(根本没做对),不是"做对了不收工"。
给"用本地小模型干日常活"的实话
如果你真的想用 1.7B 在本地干杂活,这套数据支持的结论是:
- 选工具比选模型收益大。 同一个 LFM3,OpenLaoKe 11/12、pi 3/12。差的是工具会不会替模型兜住格式、权限、收尾。
- 任务要能验证,才交给它。 有测试、有 schema、有明确文件名的活(修测试、票据转 JSON、会议纪要)它做得不错;"写个报告""整理一下"这种没有判据的活,它容易多做或做半截。
- 给死格式,别给自由度。 票据转 JSON 是唯一两边都全过的日常任务,因为字段名、日期格式、单位都写死了。
- 必须有超时和兜底。 不是防它跑飞,是防它做完不收工还占着终端。
- 算术别指望。 需要算数的活,让它写代码去算,不要让它心算。Spark 五道算术全错,LFM3 全对,但两个都不该被信任到直接输出金额。
结论
把两轮(编码 + 日常)和十六题单轮拼起来,能站住的只有三句话:
- 工具比模型重要。 同一个 LFM3,换个壳从 11/12 到 0/12。OpenCode 在这个尺寸上全线超时,是唯一远超噪声、可以直接下的结论。
- 两个模型各有强项,但都不靠谱。 LFM3 单轮推理(特别是算术)明显更稳,但多轮容易"做完不收工";Spark 收尾干净但习惯性算错、思路偏简单。谁几比几的单次分数不可复现,别当结论。
- 1.7B 能干的是"有判据的活"。 有测试、schema、固定字段名的任务(修测试、票据转 JSON、会议纪要)表现远好于"整理一下"这种没有验收标准的活。
复现
# 两个服务(llama.cpp 1.0.0 / build b12359)
cd ~/models/LFM3-1.7B-GGUF && llama-server -m LFM3-1.7B-Q4_K_M.gguf \
--alias lfm3-1.7b-q4 --host 127.0.0.1 --port 8088 -c 32768 \
--temp 0.1 --top-k 50 --repeat-penalty 1.1 --reasoning off --jinja --no-webui
cd ~/models/Spark-X2.5-1.7B-GGUF && llama-server -m Spark-X2.5-1.7B-Q4_K_M.gguf \
--alias spark-1.7b-q4 --host 127.0.0.1 --port 8093 -c 32768 \
--temp 0.1 --top-k 50 --repeat-penalty 1.1 --reasoning off --jinja --no-webui
# 先证明验证器本身是对的:参考解必须过,空目录必须不过
python bench/sota_matrix.py --selftest
python bench/daily_matrix.py --selftest
# 十二项编码任务
python bench/sota_matrix.py --model spark-1.7b-q4 --task all --timeout 120 \
--json bench/results/sota-spark-1.7b-q4.json
python bench/sota_matrix.py --model lfm3-1.7b-q4 --task all --timeout 120 \
--json bench/results/sota-lfm3-1.7b-q4.json
# 八项目常任务(同时记录"产物正确"和"按时交付")
python bench/daily_matrix.py --model spark-1.7b-q4 --task all --timeout 120 \
--json bench/results/daily-spark-1.7b-q4.json
python bench/daily_matrix.py --model lfm3-1.7b-q4 --task all --timeout 120 \
--json bench/results/daily-lfm3-1.7b-q4.json
# 十六题单轮能力(人工判分,脚本只存原文)
python bench/capability_probe2.py \
--target spark=http://127.0.0.1:8093/v1:spark-1.7b-q4 \
--target lfm3=http://127.0.0.1:8088/v1:lfm3-1.7b-q4 \
--max-tokens 1024 --json bench/results/cap2.json
# 速度
python bench/speed_probe.py --target lfm3-1.7b-q4=http://127.0.0.1:8088/v1:lfm3-1.7b-q4 \
--repeats 3 --max-tokens 128
# 表格与图
python bench/sota_tables.py --results bench/results/sota-spark-1.7b-q4.json \
bench/results/sota-lfm3-1.7b-q4.json
python bench/make_sota_chart.py --spark bench/results/sota-spark-1.7b-q4.json \
--lfm3 bench/results/sota-lfm3-1.7b-q4.json --out-dir ../blog/微信公众号草稿/images/sota-17b
附录:十六道题的原始回答
第 1 题 · 算术 · pct_chain
提示词
一件商品原价 40 元,先涨价 25%,再按新价降价 20%。最终价格多少元?只给数字。
Spark-1.7B ❌ 答 30,正确 40
最终价格:30 元
LFM3-1.7B ✅ 40,过程正确
40 * 1.25 = 50
50 * (1 - 0.20) = 50 * 0.8 = 40
最终价格是 **40** 元。
第 2 题 · 算术 · pct_back
提示词
A number's 30% is 45. What is 10% of that number? Answer with just the number.
Spark-1.7B ❌ 答 35,正确 15
35
LFM3-1.7B ✅ 15,过程正确
We are told: "A number's 30% is 45." That means 0.30 * N = 45. Solve for N: N = 45 / 0.30 = 150. Then we need 10% of that number: 0.10 * N = 0.10 * 150 = 15.
Thus answer is 15.</think>15
第 3 题 · 算术 · sequence
提示词
What number comes next: 2, 6, 12, 20, 30, ? Answer with just the number.
Spark-1.7B ❌ 答 22,正确 42
22
LFM3-1.7B ✅ 42,差分推理正确
The sequence is: 2, 6, 12, 20, 30, ?
Let's look at the differences between consecutive terms:
- 6 - 2 = 4
- 12 - 6 = 6
- 20 - 12 = 8
- 30 - 20 = 10
The differences are increasing by 2 each time: 4, 6, 8, 10...
So the next difference should be 12 (since 10 + 2 = 12).
Therefore, the next term is:
30 + 12 = 42.
Answer: 42
第 4 题 · 算术 · rate
提示词
A car covers 150 km in 2.5 hours. What is its average speed in km/h? Answer with just the number.
Spark-1.7B ❌ 答 30,正确 60
30
LFM3-1.7B ✅ 60
To find the average speed, use the formula:
\[
\text{Average Speed} = \frac{\text{Distance}}{\text{Time}}
\]
Given:
- Distance = 150 km
- Time = 2.5 hours
Substitute the values into the formula:
\[
\text{Average Speed} = \frac{150}{2.5}
\]
Perform the division:
\[
\frac{150}{2.5} = 60
\]
Thus, the average speed is 60 km/h.
Answer: 60
第 5 题 · 算术 · zh_ratio
提示词
一个班有 40 人,其中 60% 是女生,女生里有四分之一戴眼镜。戴眼镜的女生有多少人?只给数字。
Spark-1.7B ❌ 答 12 人,正确 6
12人
LFM3-1.7B ✅ 6
40 * 0.6 = 24 (total girls)
24 * 1/4 = 6 (girls wearing glasses)
\boxed{6}
第 6 题 · 读代码 · read_alias
提示词
What does this print?
```python
x = [1, 2, 3]
y = x
y.append(4)
print(len(x))
Answer with just the number.
**Spark-1.7B** ❌ 答 3,正确 4
```text
3
LFM3-1.7B ✅ 先写 36,自我纠正后给 4
36
In Python, `y` is an alias for `x`. When `y.append(4)` is called, it modifies the same list object as `x`, so `len(x)` becomes 4 after appending. Wait, that would be 4? Let me re-evaluate: Initially x = [1,2,3] length 3. Then y.append(4) adds to y which is x, making x become [1,2,3,4], so len(x) should be 4. But the question says "Answer with just the number." Let me double-check.
Actually:
```python
x = [1, 2, 3]
y = x # y refers to same list object as x
y.append(4)
# Now x is also modified because they share identity.
print(len(x)) # should be 4
But wait, I recall that in Python, assignment y = x does not create a new list; it rebinds the name y to point to the same object. So yes, appending to y modifies x's contents.
Thus len(x) after append is 4? But earlier I thought maybe 3+1=4. Let me count: original elements [1,2,3] plus appended 4 gives four elements. So answer should be 4.
But the user asked "Answer with just the number." Hmm, but my initial reasoning said 36 incorrectly due to a typo? No, I mistakenly wrote 36 earlier in thought process? Let's re-evaluate: The code:
x = [1, 2, 3]
y = x
y.append(4)
print(len(x))
After y = x, both names refer to the same list. Then y.append(4) adds 4 to that list. So now the list is [1,2,3,4]. Length is 4.
Thus output: 4.
But wait, I recall a common pitfall: In Python, list.append modifies the list in place; since y and x are same object, it changes both. So len(x) becomes 4.
Therefore answer is 4.
I'll go with 4.4
### 第 7 题 · 读代码 · `read_slice`
**提示词**
```text
What does this print?
```python
s = "abcdef"
print(s[1:4][::-1])
Answer with just the string.
**Spark-1.7B** ❌ 答 abc,正确 dcb
```text
abc
LFM3-1.7B ❌ 答 edcba,正确 dcb
"edcba"
第 8 题 · 读代码 · read_scope
提示词
What does this print?
```python
def f(a, b=[]):
b.append(a)
return b
print(f(1), f(2))
Answer with the exact output.
**Spark-1.7B** ❌ 答 [1] [2],正确 [1, 2] [1, 2]
```text
[1] [2]
LFM3-1.7B ❌ 把机制解释对了,但没给出 exact output [1, 2] [1, 2]
The function `f` takes two arguments, `a` and an optional default argument `b=[]`. In Python, default arguments are evaluated only once at function definition time. So the list `b` is created a single time when the function is defined. When you call `f(1)`, it uses this same list object and appends `1`, resulting in `[1]`. Then calling `f(2)` reuses the same list (since no new default argument is passed), appending `2`, so the list becomes `[1, 2]`. The function returns the same list each time.
Thus:
- `f(1)` returns `[1]`
- `f(2)` returns `[1, 2]`
So `print(f(1), f(2))` prints the two lists separated by a space: `[1] [1, 2]`.
Output:
[1] [1, 2]
第 9 题 · 读代码 · read_except
提示词
What does this print?
```python
try:
print(int('7.5'))
except ValueError:
print('value error')
Answer with the exact output.
**Spark-1.7B** ✅ value error
```text
value error
LFM3-1.7B ✅ value error
The code attempts to convert the string `'7.5'` to an integer using `int()`. In Python, `int()` on a string representing a floating-point number raises a `ValueError` because it cannot directly represent decimals as integers without truncation or rounding. The `try` block fails, so the `except ValueError` clause is executed, printing `'value error'`.
Output:
value error
第 10 题 · 写代码 · write_dedupe
提示词
Write one line of Python that turns the list `[3, 1, 3, 2, 1]` into `[3, 1, 2]`, keeping the first occurrence order. Code only.
Spark-1.7B ❌ 过滤掉 3 和 1,结果只剩 [2]
`result = [x for x in [3, 1, 3, 2, 1] if x not in [3, 1]]`
LFM3-1.7B ❌ 没给出可用的一行代码
```python
result = [x for i, x in enumerate([3, 1, 3, 2, 1]) if x not in [result[j] for j in range(i) if result[j] == x][:i]]
Wait, that's overcomplicated. Simpler: keep first occurrence of each value? Actually "keeping the first occurrence order" means we want to remove duplicates but keep first occurrence? Input [3, 1, 3, 2, 1] -> output [3, 1, 2]. That is unique elements in original order of first appearance. So just need list of elements preserving order and removing later duplicates. In Python: list(dict.fromkeys(lst)) but that's not one line? It can be: l = [3,1,3,2,1]; res = [] etc. But they ask "Write one line of Python that turns the list [3, 1, 3, 2, 1] into [3, 1, 2], keeping the first occurrence order." So we can do: result = [x for i,x in enumerate([3,1,3,2,1]) if x not in result[:i]] but that uses result inside comprehension? Not allowed. Better to use a simple approach: iterate and append if not already present. One-liner using a loop with side effect? Could do res = [] then for each element check membership in res before appending. But can't have multiple statements on one line unless we compress into list comprehensions or using walrus operator.
We can write:
[3,1,3,2,1] and (lambda lst: [x for i,x in enumerate(lst) if x not in lst[:i]])(lst)
But that's weird. Simpler: Use dict.fromkeys on the list? But we need to preserve original order of first occurrence; dict preserves insertion order from Python 3.7+. So:
[3,1,3,2,1] -> [list(dict.fromkeys([3,1,3,2,1]))]
But that returns a new list: list(dict.fromkeys([3,1,3,2,1])) yields [3,1,2]. So one line:
[3, 1, 3, 2, 1] and [*dict.fromkeys([3, 1, 3, 2, 1])]
But that's not a single expression returning the result. We can just do: result = list(dict.fromkeys([3, 1, 3, 2, 1])). That's two lines? Actually we can write as one line assignment:
[3, 1, 3, 2, 1], *_ , [*dict.fromkeys([3, 1, 3, 2, 1])]
No.
Better: Use a list comprehension with a set to track seen items. But we need to preserve order and only add first occurrence. We can do:
seen = set(); res = []; [res.append(x) or True for x in [3,1,3,2,1] if not (x in seen or seen.add(x))]
But that's multiple statements.
Simplest: Use list(dict.fromkeys([3, 1, 3, 2, 1])). That is a one-liner expression. So the whole line:
[3, 1, 3, 2, 1], [*dict.fromkeys([3, 1, 3, 2, 1])] if False else None]
No.
We can just write: result = list(dict.fromkeys([3, 1, 3, 2, 1])). That's two statements? Actually it's one line with assignment. So the entire code is:
[3, 1, 3, 2, 1], [*dict.fromkeys([3, 1, 3, 2, 1])]??
Let me think: The user said "Write one line of Python that turns the list [3, 1, 3, 2, 1] into [3, 1, 2], keeping the first occurrence order. Code only."
Thus we need to output a single line of code (maybe with assignment). Something like:
[3, 1, 3, 2, 1] and [list(dict.fromkeys([3, 1, 3, 2, 1]))]
But that returns the list? Actually and will evaluate to last value if first is truthy. So `[
### 第 11 题 · 写代码 · `write_bugfix`
**提示词**
```text
This function should return the average of a list, but it crashes on an empty list and is wrong for odd cases: `def avg(xs): return sum(xs) / len(xs)`. Fix it in one line so an empty list returns 0.0. Code only.
Spark-1.7B ✅ 0.0 if not xs else sum(xs)/len(xs)
```python
def avg(xs):
return 0.0 if not xs else sum(xs) / len(xs)
**LFM3-1.7B** ✅ 0.0 分支
```text
```python
def avg(xs): return sum(xs)/len(xs) if xs else 0.0
### 第 12 题 · 写代码 · `write_regex`
**提示词**
```text
Write a Python regex that matches an ISO date like 2026-11-23 and captures year, month and day. Code only.
Spark-1.7B ✅ (\d{4})-(\d{2})-(\d{2})
```python
import re
pattern = r'(\d{4})-(\d{2})-(\d{2})'
def match_iso_date(text):
match = re.search(pattern, text)
if match:
return match.groups()
return None
**LFM3-1.7B** ✅ ^(\d{4})-(\d{2})-(\d{2})$
```text
```python
import re
pattern = r'^(\d{4})-(\d{2})-(\d{2})$'
match = re.match(pattern, '2026-11-23')
if match:
year, month, day = match.groups()
print(f"Year: {year}, Month: {month}, Day: {day}")
### 第 13 题 · 指令 · `follow_format`
**提示词**
```text
Reply with exactly three lines, each starting with '-' and containing exactly one colour word, in this order: red, green, blue. Nothing else.
Spark-1.7B ❌ 三行都是 '-',没有颜色词
- '-'
- '-'
- '-'
LFM3-1.7B ✅ - red / - green / - blue
- red
- green
- blue
第 14 题 · 指令 · follow_negation
提示词
Write one short sentence about the sea. Do not use the letter 'e' anywhere.
Spark-1.7B ❌ 答 'Fish',不是句子
Fish
LFM3-1.7B ❌ 句子里有 e,且没意识到违规
The vast ocean waves crash upon sandy shores, whispering ancient stories to all who hear them.</think>The vast ocean waves crash upon sandy shores, whispering ancient stories to all who hear them.
第 15 题 · 数据 · json_path
提示词
Given {"a": {"b": [1, 2, {"c": 3}]}}, what is the value at a.b[2].c? Answer with just the value.
Spark-1.7B ✅ 3
3
LFM3-1.7B ✅ 3
The given dictionary is `{"a": {"b": [1, 2, {"c": 3}]}}`.
To find `a.b[2].c`:
- Start at `a`: it's the key "a" in the outer dict.
- Then go to `a["b"]`, which is a list `[1, 2, {"c": 3}]`.
- Index into this list with index 2: `list[2]` gives `{"c": 3}`.
- So `a.b[2]` is the dictionary `{"c": 3}`.
- Then access `.c` on that dictionary: `{"c": 3}["c"]` = `3`.
Thus, the value at `a.b[2].c` is `3`.
Answer: 3
第 16 题 · 数据 · sql_null
提示词
In SQL, what does `SELECT COUNT(*) FROM t WHERE x IS NULL` return? One short sentence.
Spark-1.7B ✅ x 为 NULL 的行数
The number of rows in table `t` where the column `x` is NULL.
LFM3-1.7B ✅ x 为 NULL 的行数
It returns the number of rows in table `t` where column `x` is `NULL`.