Generative Input: Towards Next-Generation Input Methods Paradigm (2024)

Abstract: Since the release of ChatGPT, generative models have achieved tremendous success and become the de facto approach for various NLP tasks. However, its application in the field of input methods remains under-explored. Many neural network approaches have been applied to the construction of Chinese input method engines (IMEs). Previous research often assumed that the input pinyin was correct and focused on Pinyin-to-character (P2C) task, which significantly falls short of meeting users’ demands. Moreover, previous research could not leverage user feedback to optimize the model and provide personalized results. In this study, we propose a novel Generative Input paradigm named GeneInput. It uses prompts to handle all input scenarios and other intelligent auxiliary input functions, optimizing the model with user feedback. The results demonstrate that we have achieved state-of-the-art performance for the first time in the Full-mode Key-sequence to Characters task. GeneInput also includes RLHF-IME, a novel RLHF application framework for input method, that eliminates the need for manual ranking annotations and the performance surpasses GPT-4. Relevant resources have been open-sourced.

## introduction one of the primary objectives of imes is to assist users in efficient text input. in some asian languages, such as chinese, japanese they do not use alphabetic characters and cannot be directly inputted through a standard keyboard. users often need to employ commercial input software, such as google input method 2 , sogou input method 3 , *equal contributions by alphabetical order. 1 https://github.com/spirit-wang/ generative-input/tree/master 2 https://www.google.com/inputtools/services/ features/input-method.html 3 https://pinyin.sogou.com/ iflytek input method foot_0 , and so on, to accomplish text input. pinyin serves as the official romanization system for the chinese language. in china, there are two common keyboard input methods: the 9-key keyboard and the 26-key keyboard. each of these keyboard inputs further includes different input modes. in practice, user input scenarios are highly complex, with typical input modes illustrated in figure 1 , which illustrates various potential input modes for the chinese sentence "我爱自然语言 处理" (i love natural language processing). some of the possible input modes include: with the rapid development of ai technology, the functionality of input methods has far exceeded p2c task. new features have emerged, such as intelligent association, conversational assistance, text correction, aimed at enhancing input efficiency, enjoyment and accuracy. to the best of our knowledge, there is currently no related research work covering such a wide range of practical input modes and ai-assisted input scenarios. traditional input methods typically treat p2c as a sequence labeling task. pre-trained models such as bert-crf @xcite and gpt @xcite have been applied to p2c task. @xcite propose knptc to integrate letter-neighbor knowledge into nmt for pinyin error correction. this paper, for the first time, explores the feasibility of using a unified generative framework to model all typical tasks in imes. it unifies the tasks as text generation tasks, completely overturning the previous paradigm of constructing imes. addressing the uncertainty in the task of mapping key sequences to character sequences in real input scenarios, a two-stage decoding strategy is proposed. to tackle the significant issue of noise in input, a soft constraint strategy is introduced, enabling users' key sequences to yield optimal text results. unlike traditional input method models with fixed resources, this paper introduces a user feedback-based reinforcement learning approach in the context of imes, allowing the online updating of the model and greatly enhancing its selfevolving capabilities. the primary contributions of this paper are three-fold: 1) a novel generative input method framework is proposed, achieving state-of-the-art performance. 2) an optimization architecture of reinforcement learning based on user feedback is introduced in the context of imes, enabling online automatic optimization of llm. 3) addressing complex real-world user input scenarios, a two-stage decoding strategy and a soft constraint strategy are proposed. ## tasks we selected the three most representative tasks in the input method scenarios for our research. full-mode key-sequence to characters (fk2c) this task is the core function of the input method. previous studies commonly assumed that the input sequence is noise-free and follows a specific mode, focusing solely on the conversion from pinyin to characters, denoted as p2c. however, the challenges in actual input scenarios are much more difficult, as illustrated in fig1, and the same key sequence may correspond to different input mode results. therefore, directly modeling the conversion of key sequences to characters is a more challenging task than traditional p2c tasks. intelligent association (intelassoc) this is a typical text continuation task, which predicts the user's expected next sentence based on the previous content to improve input efficiency. conversational assistance (convassist) this is a text beautification task, rewriting the input to meet specific requirements, such as being more humorous, without changing the user's semantics. ## methodology in this paper, we propose a generative modeling scheme geneinput to uniformly model the typical tasks and different input modes contained in the input method scenario, as figure 2(b) shows. it leverages an llm to model pinyin decoding tasks in various noisy scenarios, various ai-assisted input functionalities, and utilizes user feedback to automatically adjust and optimize the model. additionally, it integrates historical user input information to provide personalized results. ## conclusion in this work, we explore how the next-generation generative paradigm geneinput can be employed to uniformly model typical tasks within imes using generative models through prompts. we harness the text generation capability of the model to empower the input method system, extending their functionality beyond mere p2c and full-mode k2c is realized for the first time. furthermore, we introduced rlhf-ime, a novel human preference alignment framework, allowing online model updates without the need for external annotated data, and achieved state-of-the-art performance across all downstream tasks. in the future, we plan to address more auxiliary input functions and further reduce the model size to make it capable of running efficiently on most smartphones while maintaining high performance.