🤖 AI Summary
Large language models (LLMs) face challenges in domain-specific tasks—such as financial sentiment analysis and monetary policy interpretation—due to insufficient domain knowledge activation and limited reasoning accuracy; the relationship between prompt length and model performance remains poorly characterized. This work systematically quantifies the marginal effect of prompt length on professional-domain tasks for the first time, conducting controlled experiments across six financial and legal benchmark datasets using open-source models (e.g., LLaMA, Qwen), augmented by attention visualization and token-level gradient attribution analysis. Results reveal a significant nonlinear relationship between prompt length and performance: excessively long prompts degrade domain-specific reasoning accuracy—up to a 11.7% drop in peak accuracy. We propose a length-adaptive prompt truncation strategy that, when applied at optimal lengths, yields an average F1-score improvement of 3.2%. Our findings provide an interpretable, reusable methodology for prompt engineering in professional-domain applications.
📝 Abstract
In recent years, Large Language Models have garnered significant attention for their strong performance in various natural language tasks, such as machine translation and question answering. These models demonstrate an impressive ability to generalize across diverse tasks. However, their effectiveness in tackling domain-specific tasks, such as financial sentiment analysis and monetary policy understanding, remains a topic of debate, as these tasks often require specialized knowledge and precise reasoning. To address such challenges, researchers design various prompts to unlock the models' abilities. By carefully crafting input prompts, researchers can guide these models to produce more accurate responses. Consequently, prompt engineering has become a key focus of study. Despite the advancements in both models and prompt engineering, the relationship between the two-specifically, how prompt design impacts models' ability to perform domain-specific tasks-remains underexplored. This paper aims to bridge this research gap.