## 3 The Proposed Framework
### Chinese Couplet Generation Model  
Pre-trained LLMs demonstrate strong language understanding capabilities, enabling them to perform well across a wide range of NLP tasks. However, for specialized tasks with unique requirements, such as PCcG, their performance is often suboptimal. A common solution to this problem is supervised fine-tuning (SFT), which involves refining the model using a task-specific dataset. However, SFT for LLMs requires a dataset in a conversational format, which differs from traditional end-to-end neural network datasets. This discrepancy means that no existing dataset is directly suitable for PCcG. To address this gap, we first constructed a PCcG dataset that incorporates embedded words and specified creative intent. We then used this dataset to SFT the base model. For dataset construction, we proposed a method to transform traditional couplet datasets into a conversational format. First, data collection: We utilized the large corpus of couplelets in the RAG module's database as the source data. Second, designing a dialogue template: Since conversational training data are required, we designed a dialogue template. The structure of this template is as follows:  
* User: _Create a couplet: At the character level, \(<\)\(f_{1}(p)\)\(>\); In terms of meaning, \(<\)\(f_{2}(p)\)\(>\); Reference, \(<\)\(d_{e}\)\(>\)._
* LLM: \(<\)_original Chinese couplet\(>\)._  
Where we populate the \(f_{1}(p)\) and \(f_{2}(p)\) slots with personalized needs, including detailed embedded words and overall creative intent. The \(d_{e}\) slot is filled with the example retrieved through RAG, while the original couplet is used as the response. Third, extracting embedded words. Since embedded words can appear in any position within the couplet and are not necessarily placed symmetrically, we design a method to randomly select one word each from the antecedent and subsequent clauses of a cleaned couplet (with all punctuation removed) as the embedded words. Fourth, obtaining creative intent. As it is impractical to have experts manually analyze the creative intent of a large corpus of couplelets, we use an LLM as an analysis agent to infer creative intent automatically. The process of deriving the creative intent for each couplet is as follows. Instead of directly prompting the model to produce the creative intent, we first guide it to conduct a holistic analysis of the couplet. The initial prompt used is as follows: \"Analyze all aspects of the couplet, which must include the creative intention and provide the result\". For each couplet, we repeat this analysis three times independently using the same prompt. Then, we use the following integration prompt: \"Integrated multiple analysis results summarize the creative intention of the couplet\" to let the model summarize the creative intent based on the previously generated analyses. In terms of implementation, we developed a loop function that automates this process for each couplet. The content of  
Figure 3: Illustration of progressive prompt strategy. The RAG is always used to provide related context for generating an answer; however, here, we use RAG not to provide a context, but to find a reference couplet to guide the model to follow the norms and structure of couplelets, which enhances the formal correctness and structural diversity of couplelets. each prompt is dynamically filled with the target couplet and the corresponding multiple analysis results. Our overall idea is to allow the model to generate multiple interpretations and then synthesize them into a more stable and consistent creative intent. This approach reduces randomness and enhances consistency to some extent. Finally, the processed data are populated into the template and converted into a conversational format. Additionally, when training the base model, we employ the LoRA method.