通过分而治之提升大模型字符级操作能力
Enhancing LLM Character-Level Manipulation via Divide and Conquer
- 将复杂操作拆解为字符级子任务,再逐步重构文本
- 无需额外训练,字符删除/插入/替换准确率显著提升
- 适合需要精细文本编辑的代码生成与数据清洗场景
大语言模型在自然语言处理任务中表现出强大泛化能力,但在字符级字符串操作上仍存在明显短板,难以完成字符删除、插入和替换等基础操作。这主要源于分词机制限制,尽管此类操作在数据预处理和代码生成中至关重要。通过系统分析,我们得出两个关键发现:(1)大模型难以利用内在的分词知识进行字符级推理;(2)原子化词结构能显著增强模型对分词级结构信息的处理能力。基于此,我们提出一种名为“分而治之”的字符级操作新方法,将复杂操作分解为显式的字符级子任务,并加入受控的分词重建阶段,显著提升准确率。该方法无需额外训练,在删除、插入、替换任务上均实现显著性能提升。为支持后续研究,我们开源了实现与基准测试集。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have demonstrated strong generalization capabilities across a wide range of natural language processing (NLP) tasks. However, they exhibit notable weaknesses in character-level string manipulation, struggling with fundamental operations such as character deletion, insertion, and substitution. These challenges stem primarily from tokenization constraints, despite the critical role of such operations in data preprocessing and code generation. Through systematic analysis, we derive two key insights: (1) LLMs face significant difficulties in leveraging intrinsic token knowledge for character-level reasoning, and (2) atomized word structures can substantially enhance LLMs' ability to process token-level structural information. Building on these insights, we propose Character-Level Manipulation via Divide and Conquer, a novel approach designed to bridge the gap between token-level processing and character-level manipulation. Our method decomposes complex operations into explicit character-level subtasks coupled with controlled token reconstruction phases, leading to significant improvements in accuracy. Without additional training, our method significantly improves accuracies on the $\texttt{Deletion}$, $\texttt{Insertion}$, and $\texttt{Substitution}$ tasks. To support further research, we open-source our implementation and benchmarks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。