Skip to content

Commit c3e1919

Browse files
authored
Merge branch 'main' into backend
2 parents ce65f09 + 08d4d26 commit c3e1919

5 files changed

Lines changed: 266 additions & 152 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Prompt Repetition Improves Non-Reasoning LLMs
3+
description: 复读机或可提高大模型能力
4+
date: "2026-03-05"
5+
tags:
6+
- AI
7+
- LLMs
8+
- arXiv
9+
docId: l6eepr5ctjgrhdgupy3twr1t
10+
---
11+
12+
<https://arxiv.org/pdf/2512.14982>
13+
14+
When not using reasoning, repeating the input prompt improves performance for popular models (Gemini, GPT, Claude, and Deepseek) without increasing the number of generated tokens or latency.
15+
16+
1. Prompt Repetition LLMs are often trained as causal language models, i.e. past tokens cannot attend to future tokens. Therefore, the order of the tokens in a user’s query can affect prediction performance. For example, a query of the form “ ” often performs differently from a query of the form “ ” (see options-first vs. question-first in Figure 1). We propose to repeat the prompt, i.e. transform the input from “ ” to “ ”. This enables each prompt token to attend to every other prompt token, addressing the above. When not using reasoning, prompt repetition improves the performance of LLMs (Figure 1) without increasing the lengths of the generated outputs or latency

generated/doc-contributors.json

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"repo": "InvolutionHell/involutionhell",
3-
"generatedAt": "2026-03-09T17:47:42.725Z",
3+
"generatedAt": "2026-04-09T17:09:54.691Z",
44
"docsDir": "app/docs",
5-
"totalDocs": 148,
5+
"totalDocs": 149,
66
"results": [
77
{
88
"docId": "ue27z7z95yzw3lhhfj7nit1c",
@@ -1687,6 +1687,41 @@
16871687
}
16881688
]
16891689
},
1690+
{
1691+
"docId": "l6eepr5ctjgrhdgupy3twr1t",
1692+
"path": "app/docs/CommunityShare/Amazing-AI-Tools/prompt-repetition-improves-non-reasoning-llms.md",
1693+
"contributorStats": {
1694+
"128119791": 1,
1695+
"138507318": 1,
1696+
"163523387": 1
1697+
},
1698+
"contributors": [
1699+
{
1700+
"githubId": "138507318",
1701+
"contributions": 1,
1702+
"lastContributedAt": "2026-04-09T16:29:54.000Z",
1703+
"login": "TinyAlmond",
1704+
"avatarUrl": "https://avatars.githubusercontent.com/u/138507318?v=4",
1705+
"htmlUrl": "https://github.com/TinyAlmond"
1706+
},
1707+
{
1708+
"githubId": "163523387",
1709+
"contributions": 1,
1710+
"lastContributedAt": "2026-04-01T04:11:16.000Z",
1711+
"login": "Mira190",
1712+
"avatarUrl": "https://avatars.githubusercontent.com/u/163523387?v=4",
1713+
"htmlUrl": "https://github.com/Mira190"
1714+
},
1715+
{
1716+
"githubId": "128119791",
1717+
"contributions": 1,
1718+
"lastContributedAt": "2026-03-05T01:19:27.000Z",
1719+
"login": "CeitherNSW",
1720+
"avatarUrl": "https://avatars.githubusercontent.com/u/128119791?v=4",
1721+
"htmlUrl": "https://github.com/CeitherNSW"
1722+
}
1723+
]
1724+
},
16901725
{
16911726
"docId": "gj4bn01un0s0841berfvwrn5",
16921727
"path": "app/docs/CommunityShare/Geek/cloudflare-r2-sharex-free-image-hosting.mdx",
@@ -2072,13 +2107,13 @@
20722107
"docId": "zuoplhoodv7tzfgku0pwzi6w",
20732108
"path": "app/docs/CommunityShare/Leetcode/[1545]找出第 N 个二进制字符串中的第 K 位.md",
20742109
"contributorStats": {
2075-
"114939201": 1
2110+
"114939201": 2
20762111
},
20772112
"contributors": [
20782113
{
20792114
"githubId": "114939201",
2080-
"contributions": 1,
2081-
"lastContributedAt": "2026-03-09T17:41:04.000Z",
2115+
"contributions": 2,
2116+
"lastContributedAt": "2026-03-09T17:47:55.000Z",
20822117
"login": "longsizhuo",
20832118
"avatarUrl": "https://avatars.githubusercontent.com/u/114939201?v=4",
20842119
"htmlUrl": "https://github.com/longsizhuo"
@@ -2727,13 +2762,13 @@
27272762
"docId": "aslw60tfyzxqga598pt4ociu",
27282763
"path": "app/docs/CommunityShare/Leetcode/index.mdx",
27292764
"contributorStats": {
2730-
"114939201": 1
2765+
"114939201": 2
27312766
},
27322767
"contributors": [
27332768
{
27342769
"githubId": "114939201",
2735-
"contributions": 1,
2736-
"lastContributedAt": "2026-03-09T17:41:04.000Z",
2770+
"contributions": 2,
2771+
"lastContributedAt": "2026-03-09T17:47:55.000Z",
27372772
"login": "longsizhuo",
27382773
"avatarUrl": "https://avatars.githubusercontent.com/u/114939201?v=4",
27392774
"htmlUrl": "https://github.com/longsizhuo"

lib/source.ts

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,43 @@
11
import { docs } from "@/.source";
2-
import { loader } from "fumadocs-core/source";
2+
import { loader, getSlugs } from "fumadocs-core/source";
3+
import { pinyin } from "pinyin-pro";
4+
5+
// 拼音转换工具,仅针对中文部分转换,保留原本的标点和数字
6+
function convertSlugToPinyin(text: string) {
7+
// 核心修复点:Fumadocs 内部生成的 slugs 可能是被 encode 处理过的(%E6%BC...),需要先解码再判断汉字
8+
const decodedText = decodeURIComponent(text);
9+
10+
if (!/[\u4e00-\u9fa5]/.test(decodedText)) return text;
11+
12+
return pinyin(decodedText, {
13+
toneType: "none",
14+
type: "array",
15+
nonZh: "consecutive",
16+
})
17+
.map((t) => t.toLowerCase().replace(/[^a-z0-9]/g, "")) // 进一步清理非字母数字字符
18+
.filter(Boolean)
19+
.join("-");
20+
}
321

422
export const source = loader({
523
baseUrl: "/docs",
624
source: docs.toFumadocsSource(),
25+
transformers: [
26+
({ storage }) => {
27+
for (const path of storage.getFiles()) {
28+
const file = storage.read(path);
29+
if (
30+
file &&
31+
file.format === "page" &&
32+
path.startsWith("CommunityShare/Leetcode/")
33+
) {
34+
const defaultSlugs = getSlugs(path);
35+
const newSlugs = defaultSlugs.map(convertSlugToPinyin);
36+
37+
// 强制覆盖 Fumadocs-MDX 预生成的 slugs
38+
file.slugs = newSlugs;
39+
}
40+
}
41+
},
42+
],
743
});

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@types/mdx": "^2.0.13",
4949
"@types/pg": "^8.16.0",
5050
"@vercel/speed-insights": "^1.2.0",
51-
"ai": "^5.0.100",
51+
"ai": "^5.0.102",
5252
"antd": "^5.27.4",
5353
"baseline-browser-mapping": "^2.9.4",
5454
"class-variance-authority": "^0.7.1",
@@ -62,9 +62,11 @@
6262
"fumadocs-ui": "^15.7.13",
6363
"lucide-react": "^0.544.0",
6464
"motion": "^12.23.16",
65-
"next": "16.1.5",
65+
"next": "16.1.7",
66+
"next-auth": "5.0.0-beta.30",
6667
"next-intl": "^4.3.9",
6768
"pg": "^8.18.0",
69+
"pinyin-pro": "^3.28.0",
6870
"react": "19.2.3",
6971
"react-dom": "19.2.3",
7072
"rehype-autolink-headings": "^7.1.0",

0 commit comments

Comments
 (0)