# 大语言模型辅助数据整理

**大语言模型辅助数据整理**是指使用大语言模型（LLM）将原始、不一致且杂乱的数据转换为结构化、可用的格式，这一过程传统上称为[数据整理](https://www.edgepedia.org/zh/data-wrangling)或数据准备。与手写规则或任务专用机器学习流水线不同，LLM 接收序列化数据作为提示，并返回清洗、匹配、插补或转换后的输出，通常无需任务专用训练。<sup>[1](https://xplorestaging.ieee.org/document/11623415/)</sup><sup> • </sup><sup>[2](https://hazyresearch.stanford.edu/blog/2023-01-13-datawrangling)</sup>

| 关键事实 | 详情 |
|---|---|
| 动机 | 数据科学家将 50% 至 80% 的时间花在数据整理上，很大程度上是因为“脏数据”<sup>[1](https://xplorestaging.ieee.org/document/11623415/)</sup> |
| 主要数据形式 | 表格数据占数据格式的 73% 以上，包含文本描述、数值、格式和嵌入公式<sup>[1](https://xplorestaging.ieee.org/document/11623415/)</sup> |
| 核心任务 | 表格数据的纠正、插补、规范化、集成和解释<sup>[1](https://xplorestaging.ieee.org/document/11623415/)</sup> |
| 早期证据 | 仅用 10 个示例的 GPT-3 在五项数据整理任务的 14 个基准数据集中的 11 个上达到或超过最先进的机器学习方法<sup>[2](https://hazyresearch.stanford.edu/blog/2023-01-13-datawrangling)</sup> |
| 主要风险 | 生成数据中的幻觉、不一致、逻辑矛盾和偏差，在用于分析前需要验证<sup>[3](https://www.sciencedirect.com/science/article/pii/S0097849326000166)</sup> |
| 缓解方向 | 将检索增强与基于图的知识系统结合，在一个 510 题的推理基准上把准确回答率从 29% 提高到 66%<sup>[4](https://www.itpro.com/business/data-and-insights/this-new-technique-could-improve-ai-output-accuracy-by-80-percent-and-tackle-hallucinations-once-and-for-all)</sup> |

## 背景：数据整理瓶颈

数据整理是将数据从现有表示转换为适合分析的形式的过程，包括发现、清洗、集成和重构。<sup>[5](https://link.springer.com/article/10.1007/s42979-023-01828-8)</sup> 这是一个劳动密集型的瓶颈：调查显示，数据科学家在开始分析之前，可能将多达 80% 的时间用于提取、整理和清洗数据。<sup>[5](https://link.springer.com/article/10.1007/s42979-023-01828-8)</sup> 传统方法分为基于程序、基于工作流、基于数据集和基于自动化的系统，所有这些都需要工程投入、硬编码知识或标注数据。<sup>[5](https://link.springer.com/article/10.1007/s42979-023-01828-8)</sup><sup> • </sup><sup>[2](https://hazyresearch.stanford.edu/blog/2023-01-13-datawrangling)</sup>

这一问题的商业分量很大；Grand View Research 预测，数据准备工具市场到 2025 年将达到 84.7 亿美元，复合年增长率为 25.1%。<sup>[5](https://link.springer.com/article/10.1007/s42979-023-01828-8)</sup>

## LLM 如何应用

基础性演示来自一个斯坦福团队，成员包括阿瓦尼卡·纳拉扬（Avanika Narayan）、伊内斯·沙米（Ines Chami）、劳雷尔·奥尔（Laurel Orr）、西姆兰·阿罗拉（Simran Arora）和克里斯托弗·雷（Christopher Ré）。他们在 2022 年将五项数据清洗与集成任务转化为自然语言提示问题：模式匹配、实体匹配、错误检测、数据插补和数据转换。<sup>[2](https://hazyresearch.stanford.edu/blog/2023-01-13-datawrangling)</sup><sup> • </sup><sup>[6](https://arxiv.org/abs/2205.09911)</sup> 表格行被序列化为文本，问题模板用序列化后的值补全，模型生成答案，例如判断两条产品记录是否描述同一物品的“是/否”判断。<sup>[2](https://hazyresearch.stanford.edu/blog/2023-01-13-datawrangling)</sup> 由于 LLM 支持上下文学习，非专家可以通过编写提示来应用它们，而无需训练模型，这使数据流水线更容易被业务用户使用。<sup>[2](https://hazyresearch.stanford.edu/blog/2023-01-13-datawrangling)</sup>

后续工作证实并扩展了这一模式。张浩辰（Haochen Zhang）、董宇阳（Yuyang Dong）、肖川（Chuan Xiao）和小山田雅文（Masafumi Oyamada）在 VLDB 2024 研讨会上的一项研究表明，GPT-4 使用思维链推理和批量提示（将多个数据实例分组到一个提示中，以降低 API 成本和延迟），在错误检测、数据插补和实体匹配上达到最先进性能，往往超过专用基线。<sup>[7](https://lacuna.tiptreesystems.com/work/large-language-models-as-data-preprocessors/wrk_56a7871e13578a8438d09e5fc9fba0e4)</sup> 该领域一个以任务为中心的分类法将应用分为三组：数据清洗（标准化、错误处理、插补）、数据集成（实体匹配、模式匹配）和数据丰富化（标注、剖析）。<sup>[8](https://arxiv.org/abs/2601.17058)</sup> LLM 还可以插补缺失值、标注数据项并生成语义上有意义的属性，支持合成数据集创建和数据驱动的假设检验。<sup>[3](https://www.sciencedirect.com/science/article/pii/S0097849326000166)</sup>

## 案例研究：实体匹配

实体匹配是识别指向同一现实世界实体的记录，它说明了提示策略如何影响结果。在 COLING 2025 的一项研究中，研究人员使用 GPT-4o Mini 和 GPT-3.5 Turbo 在八个记录链接数据集上进行评估，结果表明，一种比较策略（模型同时看到两条记录）比逐记录独立匹配平均高出 10.7% 的 F1 分数，而在候选记录中进行选择的策略又使 F1 平均提高 5.32%。<sup>[9](https://aclanthology.org/2025.coling-main.8.pdf)</sup> 纳入记录间交互被认定为基于 LLM 的实体匹配的关键。<sup>[9](https://aclanthology.org/2025.coling-main.8.pdf)</sup> 一项针对 155 项基于 Transformer 的实体解析研究的更广泛范围综述发现，相关文献在 2023 年后急剧增加，纳入研究中 55% 发表于 2025 年或 2026 年，并且在各基准上，仅编码器模型与仅解码器模型之间没有出现一致的架构层面优势。<sup>[10](https://www.mdpi.com/2078-2489/17/9/917)</sup>

## 验证与可靠性

LLM 生成结构化数据的好处取决于验证，因为已知 LLM 会产生幻觉、不一致、逻辑矛盾和偏差。<sup>[3](https://www.sciencedirect.com/science/article/pii/S0097849326000166)</sup> 一项基于系统文献综述的设计空间研究沿两个主要维度——数据来源和[粒度](https://www.edgepedia.org/zh/granularity)——组织验证方法，并由三个补充维度扩展：可视化技术、交互技术和工作流阶段。<sup>[3](https://www.sciencedirect.com/science/article/pii/S0097849326000166)</sup> 一个特别困难之处是主观质量，其正确性依赖上下文，难以自动验证。<sup>[3](https://www.sciencedirect.com/science/article/pii/S0097849326000166)</sup>

这种不可靠性有些是结构性的，而非偶然的。一项分析认为，幻觉源于 LLM 的数学和逻辑结构，因此从训练数据汇编到文本生成的每个阶段都带有非零的幻觉产生概率，作者将这一性质称为结构性幻觉。<sup>[11](https://arxiv.org/abs/2409.05746)</sup> 在证据合成中，一项系统综述得出结论：当前证据支持 LLM 作为需要人工验证的双重提取工作流中的辅助工具，而不是自主提取器。<sup>[12](https://www.sciencedirect.com/science/article/abs/pii/S1532046426001103)</sup>

将模型建立在外部结构化知识之上是一种缓解途径。[纽卡斯尔大学](https://www.edgepedia.org/zh/newcastle-university)英国国家数据创新中心的研究人员将检索增强生成与基于图的知识系统结合；在 510 个测试跨来源推理的问题上，准确回答率从 29% 提高到 66%，超过了仅依赖训练数据的模型和标准检索增强生成方法。<sup>[4](https://www.itpro.com/business/data-and-insights/this-new-technique-could-improve-ai-output-accuracy-by-80-percent-and-tackle-hallucinations-once-and-for-all)</sup>

## 实际限制

若干限制影响部署。模型规模很重要：在基础评估中，参数量低于 100 亿的模型开箱即用表现不如参数量超过 1000 亿的模型，需要任务专用微调才能竞争，而更大的模型则带来可扩展性和成本方面的担忧。<sup>[2](https://hazyresearch.stanford.edu/blog/2023-01-13-datawrangling)</sup> 提示是脆弱的，性能会随提示格式、用词、标点和上下文示例的选择而波动。<sup>[2](https://hazyresearch.stanford.edu/blog/2023-01-13-datawrangling)</sup> 对于分块——实体解析中的候选生成步骤——LLM 因涉及比较数量的二次方增长而成本过高。<sup>[13](https://raw.githubusercontent.com/imvladikon/imvladikon/master/articles/entity_resolution_blocking_survey.pdf)</sup> 稳健性研究还发现，LLM 对表格数据的预测对无关扰动敏感，例如问题中人名的变化，这引发了科学使用中的可复现性担忧。<sup>[14](https://academic.oup.com/pnasnexus/article/5/6/pgag197/8699520)</sup>

**混合主动式系统**通过让人参与流程来应对这些限制。Dango 是一个构建在 LLM 上的数据整理系统，它允许用户在多个表上演示转换、在对话界面中发出自然语言提示、回答 LLM 提出的多项选择澄清问题，并在接受生成的数据整理脚本之前检查逐步的自然语言解释和数据溯源。<sup>[15](https://arxiv.org/abs/2503.03154)</sup>

## References

1. [Tabular Data Wrangling in the Era of Large Language Model: A Survey, IEEE Transactions on Knowledge and Data Engineering 38(10), 2026](https://xplorestaging.ieee.org/document/11623415/)
2. [Narayan, Chami, Orr, Ré (2023). Data Wrangling with Foundation Models, Hazy Research](https://hazyresearch.stanford.edu/blog/2023-01-13-datawrangling)
3. [Systematic validation of LLM-generated structured data — A design space and remaining challenges, ScienceDirect](https://www.sciencedirect.com/science/article/pii/S0097849326000166)
4. [This new technique could improve AI output accuracy by 80%, ITPro](https://www.itpro.com/business/data-and-insights/this-new-technique-could-improve-ai-output-accuracy-by-80-percent-and-tackle-hallucinations-once-and-for-all)
5. [Fernandes et al. (2023). Data Preparation: A Technological Perspective and Review, SN Computer Science](https://link.springer.com/article/10.1007/s42979-023-01828-8)
6. [Narayan et al. (2022). Can Foundation Models Wrangle Your Data? arXiv:2205.09911](https://arxiv.org/abs/2205.09911)
7. [Zhang, Dong, Xiao, Oyamada (2024). Large Language Models as Data Preprocessors, VLDB Workshops](https://lacuna.tiptreesystems.com/work/large-language-models-as-data-preprocessors/wrk_56a7871e13578a8438d09e5fc9fba0e4)
8. [Can LLMs Clean Up Your Mess? A Survey of Application-Ready Data Preparation with LLMs, arXiv:2601.17058](https://arxiv.org/abs/2601.17058)
9. [Match, Compare, or Select? An Investigation of Large Language Models for Entity Matching, COLING 2025](https://aclanthology.org/2025.coling-main.8.pdf)
10. [Entity Resolution Using Transformer-Based Language Models: A Systematic Scoping Review, Information 17(9):917](https://www.mdpi.com/2078-2489/17/9/917)
11. [LLMs Will Always Hallucinate, and We Need to Live With This, arXiv:2409.05746](https://arxiv.org/abs/2409.05746)
12. [Performance of large language models in data extraction for evidence synthesis: A systematic review, Journal of Biomedical Informatics](https://www.sciencedirect.com/science/article/abs/pii/S1532046426001103)
13. [Recent Advances: LLMs for Entity Resolution (blocking survey)](https://raw.githubusercontent.com/imvladikon/imvladikon/master/articles/entity_resolution_blocking_survey.pdf)
14. [Robustness is important: Limitations of LLMs for predictions on tabular data, PNAS Nexus](https://academic.oup.com/pnasnexus/article/5/6/pgag197/8699520)
15. [Dango: A Mixed-Initiative Data Wrangling System using Large Language Model, arXiv:2503.03154](https://arxiv.org/abs/2503.03154)

---
*Initially written Oct 26, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › 数据库与数据系统 › 数据挖掘、数据仓库与大数据 › 数据挖掘方法论与过程模型

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/llm-assisted-data-wrangling

English original: https://www.edgepedia.org/llm-assisted-data-wrangling
