Synthesizing and Adapting Error Correction Data for Mobile Large Language Model Applications

Yanxiang Zhang, Zheng Xu, Shanshan Wu, Yuanbo Zhang, Daniel Ramage

TL;DR

This paper tackles the challenge of improving error correction (EC) in mobile LLM applications by creating a large, synthetic dataset tailored to mobile typing nuances. They introduce a novel reweighting strategy to bridge the gap between offline evaluation and real-world performance, achieving significant improvements in production.

What Problem Does This Paper Address?

Large Language Models (LLMs) are increasingly used in mobile applications to enhance user experience, particularly through features like automatic error correction (EC) and next-word prediction. However, LLMs trained on general web data often struggle with the unique characteristics of mobile typing, which includes a different distribution of errors (e.g., more typos, less formal grammar) compared to standard text. This "domain shift" leads to a performance gap between offline evaluations and real-world A/B tests. Furthermore, privacy concerns limit the direct use of user typing data for training. Existing methods for generating synthetic EC data often fall short in capturing the specific mobile domain or bridging this performance gap.

Methods

The authors propose a multi-stage approach:

  1. LLM-based Data Synthesis: They leverage LLMs (specifically Gemini Ultra) to synthesize a high-quality EC dataset. This involves prompting LLMs with domain knowledge about mobile typing errors to generate corrupted text and their corrected counterparts. This method is more scalable and reliable than traditional grammar error detectors.
  2. Domain Adaptation via Reweighting: To address the domain shift, they introduce a novel reweighting strategy. This involves training a small, privacy-preserving LLM (using federated learning with differential privacy) on user data. This small model, along with a few live A/B test metrics, is used to train a reweighting model. This model assigns weights to samples in the synthetic dataset, prioritizing those that better align with production performance.
  3. Continued Training Strategy: They employ a "continue training" strategy where LLMs are first fine-tuned on the large synthetic dataset, followed by fine-tuning on a mixture of the original dataset and the reweighted synthetic data. This approach aims to leverage the strengths of both data sources.
  4. Privacy-Preserving Techniques: Throughout the process, privacy is a key consideration. They use federated learning with differential privacy for training the small LM used in reweighting, and also mention a PII detection pipeline for the synthetic data.

Datasets

  • Original Production Dataset: A smaller, existing dataset used for error correction in production.
  • Synthetic Dataset: A newly synthesized dataset of approximately 1.2 million EC pairs, generated using LLMs and incorporating mobile-specific errors. This dataset is significantly larger than the original production dataset.
  • Public C4 Dataset: Used for pre-training the small LM employed in the reweighting strategy.

Key Insights and Ideas

  • LLMs as Data Synthesizers: LLMs can be effectively prompted to generate high-quality, domain-specific synthetic data for tasks like error correction, offering a scalable alternative to manual annotation or traditional rule-based methods.
  • The Importance of Domain Adaptation: Simply generating synthetic data isn't enough. Bridging the gap between offline evaluation and production performance requires explicit domain adaptation techniques, like the proposed reweighting method.
  • Privacy-Preserving Models for Adaptation: Small, privacy-preserving LLMs trained on user data can capture crucial domain-specific signals needed for effective adaptation, even with limited data.
  • Reweighting for Production Alignment: Reweighting samples based on predicted live A/B test metrics is a powerful way to align offline training data with real-world user behavior.
  • Continue Training Synergy: Combining large-scale synthetic data with smaller, real-world data through a continued training strategy yields superior results compared to using either dataset in isolation.

Key Results

  • The proposed LLM-synthesized dataset, when used for training, significantly improves performance on both original and synthetic validation sets compared to using only the original dataset.
  • The reweighting strategy, when applied, leads to better alignment between offline evaluation metrics and production live A/B test metrics.
  • The "ContMixFil" training strategy (combining original data with reweighted synthetic data) achieved the best performance on both original and synthetic validation data.
  • In production live A/B tests, the model trained with the proposed methods achieved a 2.47% to 7.18% relative improvement on key metrics like click-through rate and accept rate compared to the original model.

Limitations and Future Work

  • Limited Live Metrics: The reweighting model is trained using only a "handful" of live A/B test metrics. The authors acknowledge that more comprehensive live metrics could lead to further improvements.
  • Privacy-Preserving LM Size: The small LM used for reweighting has about 8 million parameters. Future work could explore the impact of larger privacy-preserving models.
  • Other Domain Adaptation Methods: The paper focuses on reweighting. Future research could explore other domain adaptation techniques.
  • Leveraging More User Data: As more data from user interactions becomes available, the proposed privacy-preserving approach can be further enhanced for personalization and agency.
  • Trusted Execution Environments: The authors suggest exploring the flexibility of next-generation FL systems in trusted execution environments for future privacy-preserving solutions.

Summary updated

BibTeX
@inproceedings{zhang2025synthesizing,
  author = {Yanxiang Zhang and Zheng Xu and Shanshan Wu and Yuanbo Zhang and Daniel Ramage},
  title = {{Synthesizing and Adapting Error Correction Data for Mobile Large Language Model Applications}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure