把输出压到 4000 token,谁能一次交出可运行的代码?
结论速览
> 实测说明:2026-11-21,同一提示词、统一 4000 token 输出上限,要求 5 家模型交出单文件待办清单 HTML。4 家产出的文件都被实际放入 Chromium 打开,逐项验证新增、完成、删除、刷新持久化。与 11 月 20 日那场 10000 token 预算的代码横评相比(DeepSeek、通义千…
本次横评产品(5)
横评任务
用单个 HTML 文件(内联 CSS 和原生 JavaScript,不使用任何外部依赖和 CDN)实现一个待办清单:1)可以添加、标记完成、删除待办;2)刷新页面后数据保留;3)界面有基本样式。要求代码完整可运行,直接双击打开就能用。请把代码严格控制在 4000 token 以内,只输出完整代码,不要任何解释。
冠军DeepSeek8.9综合分 / 10 | 亚军通义千问8.5综合分 / 10 | 季军Kimi K38.2综合分 / 10 | 第 4 名豆包7.0综合分 / 10 | 调用失败百度文心—综合分 / 10 | |
|---|---|---|---|---|---|
| 综合分 | 8.9 | 8.5 | 8.2 | 7.0 | 调用失败 |
| 质量分 | 9.0 | 9.0 | 9.1 | 8.8 | — |
| 性能分 | 8.8 | 7.4 | 6.0 | 2.8 | — |
| 正确性/可运行性 | 9.0 | 9.0 | 9.0 | 9.0 | — |
| 逻辑性 | 8.5 | 8.5 | 8.5 | 8.5 | — |
| 完整性 | 10.0 | 10.0 | 10.0 | 10.0 | — |
| 稳定性 | 9.0 | 9.0 | 9.0 | 8.0 | — |
| 风格 | 8.0 | 8.0 | 9.0 | 8.5 | — |
| 效率 | 9.5 | 9.0 | 8.5 | 7.0 | — |
| 响应耗时 | 10.3s | 21.2s | 21.3s | 64.1s | — |
| Token(入/出) | 118 / 2342 | 149 / 1762 | 174 / 1849 | 136 / 3797 | — |
| 调用费用(估算) | 免费 | ¥0.01 | ¥0.19 | ¥0.11 | — |
| 单位产出成本 | ¥0 / 分 | ¥0.0012 / 分 | ¥0.0232 / 分 | ¥0.0157 / 分 | — |
高亮为该指标最优值。综合分 = 质量分 × 70% + 性能分 × 30%;性能分 = 速度 45% + Token 效率 40% + 费用 15%(费用项最高 8 分);质量分为六维人工打分加权(正确性/可运行性 30% + 逻辑性 25% + 完整性 20% + 稳定性 10% + 风格 10% + 效率 5%)。输出被截断或可运行性 ≤ 2 时,综合分封顶 4.0。
调用费用为按各模型官方刊例价 × 真实 token 用量折算的估算值,仅代表平台 API 成本;用户使用本站横评无需付费,命中缓存的横评不产生新费用。单位产出成本 = 调用费用 ÷ 综合分,即「每得 1 分综合分的成本」,越低越划算;输出截断或可运行性 ≤ 2 的样本标注「不计」,不参与最优值比较,以免劣质结果显得便宜。
输出对比
产物可直接在线试玩(等比缩放),下方仅展示实现要点,完整源码默认折叠。
查看完整源码
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>待办清单</title>
<style>
* { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
padding: 40px 16px;
font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
background: linear-gradient(135deg, #eef2ff, #f8fafc);
color: #1f2937;
}
.app {
max-width: 540px;
margin: 0 auto;
background: #fff;
padding: 24px;
border-radius: 16px;
box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}
h1 {
margin: 0 0 20px;
font-size: 24px;
text-align: center;
}
form {
display: flex;
gap: 10px;
margin-bottom: 20px;
}
input[type="text"] {
flex: 1;
padding: 11px 13px;
border: 1px solid #cbd5e1;
border-radius: 10px;
font-size: 15px;
outline: none;
transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus {
border-color: #6366f1;
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
form button {
padding: 11px 18px;
border: none;
border-radius: 10px;
background: #4f46e5;
color: #fff;
font-size: 15px;
cursor: pointer;
transition: background 0.2s;
}
form button:hover { background: #4338ca; }
#list {
list-style: none;
padding: 0;
margin: 0;
}
#list li {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 12px 14px;
margin-bottom: 10px;
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 12px;
}
#list label {
display: flex;
align-items: center;
gap: 10px;
flex: 1;
min-width: 0;
cursor: pointer;
}
#list input[type="checkbox"] {
width: 18px;
height: 18px;
accent-color: #4f46e5;
cursor: pointer;
flex-shrink: 0;
}
#list span {
word-break: break-word;
font-size: 15px;
}
#list li.done span {
color: #94a3b8;
text-decoration: line-through;
}
.del {
padding: 7px 11px;
border: none;
border-radius: 8px;
background: #fee2e2;
color: #b91c1c;
cursor: pointer;
font-size: 13px;
flex-shrink: 0;
transition: background 0.2s;
}
.del:hover { background: #fecaca; }
#empty {
margin: 14px 0 0;
text-align: center;
color: #94a3b8;
font-size: 14px;
}
</style>
</head>
<body>
<div class="app">
<h1>待办清单</h1>
<form id="form">
<input id="input" type="text" placeholder="输入待办事项..." autocomplete="off">
<button type="submit">添加</button>
</form>
<ul id="list"></ul>
<p id="empty">暂无待办</p>
</div>
<script>
(function () {
const KEY = "todo_list_v1";
const form = document.getElementById("form");
const input = document.getElementById("input");
const list = document.getElementById("list");
const empty = document.getElementById("empty");
let todos = [];
try {
todos = JSON.parse(localStorage.getItem(KEY)) || [];
} catch (e) {
todos = [];
}
function save() {
localStorage.setItem(KEY, JSON.stringify(todos));
}
function render() {
list.innerHTML = "";
empty.style.display = todos.length ? "none" : "block";
todos.forEach(function (todo) {
const li = document.createElement("li");
if (todo.done) li.className = "done";
const label = document.createElement("label");
const checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkbox.checked = todo.done;
checkbox.addEventListener("change", function () {
todo.done = checkbox.checked;
save();
render();
});
const span = document.createElement("span");
span.textContent = todo.text;
label.appendChild(checkbox);
label.appendChild(span);
const del = document.createElement("button");
del.type = "button";
del.className = "del";
del.textContent = "删除";
del.addEventListener("click", function () {
todos = todos.filter(function (item) {
return item.id !== todo.id;
});
save();
render();
});
li.appendChild(label);
li.appendChild(del);
list.appendChild(li);
});
}
form.addEventListener("submit", function (e) {
e.preventDefault();
const text = input.value.trim();
if (!text) return;
todos.unshift({
id: Date.now().toString(36) + Math.random().toString(36).slice(2),
text: text,
done: false
});
input.value = "";
save();
render();
input.focus();
});
render();
})();
</script>
</body>
</html>查看完整源码
<!doctype html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>待办清单</title>
<style>
*{box-sizing:border-box}
body{margin:0;min-height:100vh;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;background:linear-gradient(135deg,#667eea,#764ba2);display:grid;place-items:center;padding:20px;color:#222}
main{width:100%;max-width:520px;background:#fff;border-radius:16px;padding:24px;box-shadow:0 12px 30px rgba(0,0,0,.18)}
h1{margin:0 0 18px;font-size:26px}
form{display:flex;gap:8px;margin-bottom:16px}
input{flex:1;padding:10px 12px;border:1px solid #d8d8d8;border-radius:8px;font-size:16px;outline:none}
input:focus{border-color:#667eea}
button{border:0;border-radius:8px;cursor:pointer;font-size:16px}
.add{padding:10px 16px;background:#667eea;color:#fff}
.add:hover{background:#5a6fd6}
ul{list-style:none;margin:0;padding:0}
li{display:flex;align-items:center;gap:10px;padding:10px 4px;border-bottom:1px solid #eee}
li:last-child{border-bottom:0}
.check{width:20px;height:20px;flex:none;accent-color:#667eea;cursor:pointer}
.text{flex:1;word-break:break-word}
.done .text{text-decoration:line-through;color:#aaa}
.del{padding:6px 10px;background:#ffe8e8;color:#d33}
.del:hover{background:#ffd0d0}
#empty{display:none;text-align:center;color:#999;margin:10px 0}
</style>
</head>
<body>
<main>
<h1>待办清单</h1>
<form id="form">
<input id="input" autocomplete="off" placeholder="输入新的待办事项" maxlength="120">
<button class="add" type="submit">添加</button>
</form>
<ul id="list"></ul>
<p id="empty">暂无待办事项</p>
</main>
<script>
const KEY = 'todo-list';
let todos = [];
try {
todos = JSON.parse(localStorage.getItem(KEY)) || [];
} catch (e) {
todos = [];
}
const form = document.getElementById('form');
const input = document.getElementById('input');
const list = document.getElementById('list');
const empty = document.getElementById('empty');
function save() {
localStorage.setItem(KEY, JSON.stringify(todos));
}
function render() {
list.innerHTML = '';
todos.forEach((todo, index) => {
const li = document.createElement('li');
if (todo.done) li.classList.add('done');
const check = document.createElement('input');
check.type = 'checkbox';
check.className = 'check';
check.checked = todo.done;
check.addEventListener('change', () => {
todos[index].done = check.checked;
save();
render();
});
const text = document.createElement('span');
text.className = 'text';
text.textContent = todo.text;
const del = document.createElement('button');
del.className = 'del';
del.textContent = '删除';
del.addEventListener('click', () => {
todos.splice(index, 1);
save();
render();
});
li.append(check, text, del);
list.appendChild(li);
});
empty.style.display = todos.length ? 'none' : 'block';
}
form.addEventListener('submit', e => {
e.preventDefault();
const text = input.value.trim();
if (!text) return;
todos.push({ text, done: false });
input.value = '';
save();
render();
});
render();
</script>
</body>
</html>查看完整源码
```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>待办清单</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
background: linear-gradient(135deg, #667eea, #764ba2);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: flex-start;
padding: 40px 16px;
}
.app {
width: 100%;
max-width: 480px;
background: #fff;
border-radius: 16px;
box-shadow: 0 20px 50px rgba(0,0,0,.3);
padding: 28px;
}
h1 {
font-size: 24px;
color: #333;
text-align: center;
margin-bottom: 20px;
}
.input-row { display: flex; gap: 10px; margin-bottom: 18px; }
#todo-input {
flex: 1;
padding: 12px 14px;
border: 2px solid #e0e0e0;
border-radius: 10px;
font-size: 15px;
outline: none;
transition: border-color .2s;
}
#todo-input:focus { border-color: #667eea; }
#add-btn {
padding: 12px 20px;
border: none;
border-radius: 10px;
background: #667eea;
color: #fff;
font-size: 15px;
cursor: pointer;
transition: background .2s;
white-space: nowrap;
}
#add-btn:hover { background: #5568d3; }
ul { list-style: none; }
.todo-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 14px;
border-radius: 10px;
background: #f7f8fc;
margin-bottom: 10px;
transition: background .2s;
animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px);} to { opacity: 1; transform: none;} }
.todo-item:hover { background: #eef1fb; }
.todo-text {
flex: 1;
font-size: 15px;
color: #333;
word-break: break-all;
cursor: pointer;
}
.todo-item.done .todo-text {
text-decoration: line-through;
color: #aaa;
}
.check-btn {
width: 24px; height: 24px;
min-width: 24px;
border: 2px solid #ccc;
border-radius: 50%;
background: #fff;
cursor: pointer;
font-size: 14px;
line-height: 1;
color: transparent;
transition: all .2s;
}
.todo-item.done .check-btn {
background: #4caf50;
border-color: #4caf50;
color: #fff;
}
.del-btn {
border: none;
background: transparent;
color: #ccc;
font-size: 18px;
cursor: pointer;
padding: 4px 8px;
border-radius: 6px;
transition: all .2s;
}
.del-btn:hover { color: #e53935; background: #ffebee; }
.empty {
text-align: center;
color: #999;
font-size: 14px;
padding: 30px 0;
}
.footer {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 16px;
font-size: 13px;
color: #888;
}
#clear-done {
border: none;
background: transparent;
color: #667eea;
cursor: pointer;
font-size: 13px;
}
#clear-done:hover { text-decoration: underline; }
</style>
</head>
<body>
<div class="app">
<h1>📝 待办清单</h1>
<div class="input-row">
<input id="todo-input" type="text" placeholder="输入待办事项,回车添加…" maxlength="100">
<button id="add-btn">添加</button>
</div>
<ul id="todo-list"></ul>
<p class="empty" id="empty-tip">暂无待办事项,快来添加吧~</p>
<div class="footer">
<span id="count"></span>
<button id="clear-done">清除已完成</button>
</div>
</div>
<script>
(function () {
var STORAGE_KEY = "simple_todo_list";
var input = document.getElementById("todo-input");
var addBtn = document.getElementById("add-btn");
var list = document.getElementById("todo-list");
var emptyTip = document.getElementById("empty-tip");
var countEl = document.getElementById("count");
var clearDoneBtn = document.getElementById("clear-done");
var todos = load();
function load() {
try {
var data = localStorage.getItem(STORAGE_KEY);
var arr = data ? JSON.parse(data) : [];
return Array.isArray(arr) ? arr : [];
} catch (e) {
return [];
}
}
function save() {
localStorage.setItem(STORAGE_KEY, JSON.stringify(todos));
}
function render() {
list.innerHTML = "";
todos.forEach(function (todo) {
var li = document.createElement("li");
li.className = "todo-item" + (todo.done ? " done" : "");
var check = document.createElement("button");
check.className = "check-btn";
check.textContent = "✓";
check.title = "标记完成/取消";
check.addEventListener("click", function () { toggle(todo.id); });
var span = document.createElement("span");
span.className = "todo-text";
span.textContent = todo.text;
span.addEventListener("click", function () { toggle(todo.id); });
var del = document.createElement("button");
del.className = "del-btn";
del.textContent = "✕";
del.title = "删除";
del.addEventListener("click", function () { remove(todo.id); });
li.appendChild(check);
li.appendChild(span);
li.appendChild(del);
list.appendChild(li);
});
emptyTip.style.display = todos.length ? "none" : "block";
var remaining = todos.filter(function (t) { return !t.done; }).length;
countEl.textContent = "共 " + todos.length + " 项,剩余 " + remaining + " 项";
}
function add() {
var text = input.value.trim();
if (!text) { input.focus(); return; }
todos.push({ id: Date.now() + Math.random(), text: text, done: false });
input.value = "";
input.focus();
save();
render();
}
function toggle(id) {
var t = todos.find(function (t) { return t.id === id; });
if (t) { t.done = !t.done; save(); render(); }
}
function remove(id) {
todos = todos.filter(function (t) { return t.id !== id; });
save();
render();
}
function clearDone() {
todos = todos.filter(function (t) { return !t.done; });
save();
render();
}
addBtn.addEventListener("click", add);
input.addEventListener("keydown", function (e) {
if (e.key === "Enter") add();
});
clearDoneBtn.addEventListener("click", clearDone);
render();
})();
</script>
</body>
</html>
```查看完整源码
```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>待办清单</title>
<style>
* { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
padding: 40px 16px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
"Hiragino Sans GB", "Microsoft YaHei", sans-serif;
background: linear-gradient(135deg, #e0f2fe, #eef2ff);
color: #1f2937;
}
.app {
max-width: 480px;
margin: 0 auto;
padding: 24px;
background: #ffffff;
border-radius: 16px;
box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}
h1 {
margin: 0 0 20px;
font-size: 26px;
text-align: center;
}
.input-row {
display: flex;
gap: 8px;
margin-bottom: 16px;
}
#todoInput {
flex: 1;
padding: 11px 12px;
border: 1px solid #d1d5db;
border-radius: 8px;
font-size: 15px;
outline: none;
transition: border-color 0.2s, box-shadow 0.2s;
}
#todoInput:focus {
border-color: #2563eb;
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
button {
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 15px;
transition: background 0.2s;
}
.add-btn {
padding: 10px 18px;
background: #2563eb;
color: #fff;
}
.add-btn:hover { background: #1d4ed8; }
ul {
list-style: none;
margin: 0;
padding: 0;
}
li {
display: flex;
align-items: center;
gap: 10px;
padding: 10px;
border-radius: 8px;
}
li:hover { background: #f9fafb; }
li input[type="checkbox"] {
width: 18px;
height: 18px;
cursor: pointer;
}
.text {
flex: 1;
word-break: break-word;
line-height: 1.5;
}
li.completed .text {
color: #9ca3af;
text-decoration: line-through;
}
.delete-btn {
padding: 6px 10px;
background: #fee2e2;
color: #dc2626;
}
.delete-btn:hover { background: #fecaca; }
.empty {
margin: 0;
padding: 24px 0;
text-align: center;
color: #9ca3af;
}
.stats {
margin-top: 14px;
font-size: 13px;
color: #6b7280;
text-align: center;
}
</style>
</head>
<body>
<main class="app">
<h1>待办清单</h1>
<div class="input-row">
<input id="todoInput" type="text" maxlength="100" placeholder="输入待办事项,按回车添加">
<button id="addBtn" class="add-btn">添加</button>
</div>
<ul id="todoList"></ul>
<p id="emptyState" class="empty">暂无待办,添加一个吧</p>
<div id="stats" class="stats"></div>
</main>
<script>
const STORAGE_KEY = "simple-todo-list";
const todoInput = document.getElementById("todoInput");
const addBtn = document.getElementById("addBtn");
const todoList = document.getElementById("todoList");
const emptyState = document.getElementById("emptyState");
const stats = document.getElementById("stats");
let todos = loadTodos();
function loadTodos() {
try {
const data = localStorage.getItem(STORAGE_KEY);
const parsed = data ? JSON.parse(data) : [];
return Array.isArray(parsed) ? parsed : [];
} catch (error) {
return [];
}
}
function saveTodos() {
localStorage.setItem(STORAGE_KEY, JSON.stringify(todos));
}
function createId() {
return Date.now().toString(36) + Math.random().toString(36).slice(2, 8);
}
function addTodo() {
const text = todoInput.value.trim();
if (!text) return;
todos.push({
id: createId(),
text: text,
completed: false
});
todoInput.value = "";
saveTodos();
renderTodos();
todoInput.focus();
}
function toggleTodo(id) {
const todo = todos.find(item => item.id === id);
if (todo) {
todo.completed = !todo.completed;
saveTodos();
renderTodos();
}
}
function deleteTodo(id) {
todos = todos.filter(item => item.id !== id);
saveTodos();
renderTodos();
}
function renderTodos() {
todoList.innerHTML = "";
todos.forEach(todo => {
const li = document.createElement("li");
if (todo.completed) li.classList.add("completed");
const checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkbox.checked = todo.completed;
checkbox.setAttribute("aria-label", "标记完成");
checkbox.addEventListener("change", () => toggleTodo(todo.id));
const text = document.createElement("span");
text.className = "text";
text.textContent = todo.text;
const deleteBtn = document.createElement("button");
deleteBtn.className = "delete-btn";
deleteBtn.textContent = "删除";
deleteBtn.addEventListener("click", () => deleteTodo(todo.id));
li.append(checkbox, text, deleteBtn);
todoList.appendChild(li);
});
emptyState.style.display = todos.length ? "none" : "block";
const remaining = todos.filter(item => !item.completed).length;
stats.textContent = todos.length
? `共 ${todos.length} 项,剩余 ${remaining} 项未完成`
: "";
}
addBtn.addEventListener("click", addTodo);
todoInput.addEventListener("keydown", event => {
if (event.key === "Enter") addTodo();
});
renderTodos();
</script>
</body>
</html>
```调用失败:HTTP 403: {"error":{"code":"account_overdue","message":"Access denied due to overdue account","type":"access_denied"},"id":"as-6p62kwjnri"}
调用异常
- 百度文心:HTTP 403: {"error":{"code":"account_overdue","message":"Access denied due to overdue account","type":"access_denied"},"id":"as-6p62kwjnri"}
评分结论
按「质量 70% + 性能 30%」加权,本场横评综合表现最佳:DeepSeek(综合分 8.9)。
质量分为测评人按正确性/可运行性 / 逻辑性 / 完整性 / 稳定性 / 风格 / 效率六维人工打分加权得出。
方法与复现
- 实测主体
- AI 大众点评实测组
- 实测日期
- 2026-11-21
- 模型版本
- 百度文心、DeepSeek、通义千问、Kimi K3、豆包
- 复现包
- 整理中
常见问题
- 《把输出压到 4000 token,谁能一次交出可运行的代码?》对比了哪些 AI 产品?
- 本次横评共覆盖 5 款产品:DeepSeek 对话、通义千问、Kimi、文心一言、豆包。所有产品在同一题目、相同环境下实测。
- 《把输出压到 4000 token,谁能一次交出可运行的代码?》的核心结论是什么?
- > 实测说明:2026-11-21,同一提示词、统一 4000 token 输出上限,要求 5 家模型交出单文件待办清单 HTML。4 家产出的文件都被实际放入 Chromium 打开,逐项验证新增、完成、删除、刷新持久化。与 11 月 20 日那场 10000 token 预算的代码横评相比(DeepSeek、通义千…
- 这份横评报告是如何产生的?
- AI 大众点评 的横评报告基于同一题目、同一任务,由真人完整操作各 AI 产品并记录全过程,评分覆盖正确性、逻辑性、完整性、稳定性、风格与效率等维度,翻车情况也会如实呈现。
评论(0)
评论加载中…


