Locale-Conditioned Few-Shot Prompting 解决 SLM 在 PII 替换中的演示复读问题
Locale-Conditioned Few-Shot Prompting Mitigates Demonstration Regurgitation in On-Device PII Substitution with Small Language Models
做设备端隐私处理或小模型应用的团队,这篇论文揭示了少样本提示中一个容易被忽视的陷阱——模型会复读演示而非推理,并给出了一个简单有效的修复方案,值得点开看看。
本文提出一种完全在设备端运行的 PII 替换流水线,使用 1.5B MoE 分类器检测实体、1-bit Bonsai-1.
7B 小语言模型生成上下文相关的假名,以及规则生成器处理模式化字段。研究发现,小模型在少样本提示下会逐字复读演示输出,而非根据输入生成。
通过引入基于语言环境的旋转演示池和 MD5 哈希采样,成功消除了 482/482 次调用中的复读现象。尽管生成的假名更自然,但在下游 NER 任务中,规则生成的多样性优于小模型的自然性,这是一个诚实的负面发现。
Locale-Conditioned Few-Shot Prompting Mitigates Demonstration Regurgitation in On-Device PII Substitution with Small Language Models
Personally Identifiable Information (PII) redaction usually replaces detected entities with placeholder tokens such as [PERSON], destroying the downstream utility of the redacted text for retrieval and Named Entity Recognition (NER) training. We propose a fully on-device pipeline that substitutes PII with consistent, type-preserving fake values: a 1.5 B mixture-of-experts token classifier (openai/privacy-filter) detects spans, a 1-bit Bonsai-1.7B Small Language Model (SLM) proposes contextual surrogates for names, addresses, and dates, and a rule-based generator (faker) handles patterned fields. We report a prompting finding more important than the quantization choice: with naive fixed three-shot demonstrations, the 1-bit SLM regurgitates demonstration outputs verbatim regardless of input; 1.58-bit Ternary-Bonsai-1.7B reproduces byte-identical failures, ruling out quantization as the cause. We fix this with locale-conditioned rotating few-shot demonstrations: a character-range heuristic picks a locale-pure pool and a per-input MD5 hash samples three demonstrations. With the fix, 482/482 unique Bonsai-1.7B calls succeed (no echoes) and produce locale-correct surrogates, although the SLM still copies from a small same-locale demonstration pool - a residual narrowness we quantify. On a 2000-document multilingual corpus, hybrid perplexity (PPL) beats faker in all six locales under a multilingual evaluator (XGLM-564M); length preservation is best-of-three in 4 of 6 locales. On downstream NER (400 train / 100 test, English), redact yields F1=0.000, faker 0.656, original 0.960; on a matched 160/40 subset including hybrid, faker (0.506) outperforms hybrid (0.346) at p < 0.001. We report this as an honest negative finding: SLM surrogates produce more natural text but a less varied training distribution, and downstream NER benefits more from variety than from naturalness.
This report is categorized under AITOP's "Papers" desk. Key entities and technical topics under continuous tracking include small language models, few-shot prompting, on-device inference, privacy.
Primary source verification: published directly by arXiv: OpenAI with first-party authority.