Abstract
Community Question Answering (CQA) platforms like Stack Overflow are essential for software developers, yet Pretrained Language Models (PLMs) often struggle with the domain's inherent heterogeneity. We present a three-stage pipeline to enhance PLM performance in the programming domain. Our approach involves decomposing forum data into thematic subsets, fine-tuning models using Reinforcement Learning with Human Feedback (RLHF) derived from community voting, and employing an ensemble management strategy via question classification. Using Llama 7B on Python-specific data, we achieved a 22.5% improvement in Rouge metrics through classification and a further 11.2% through RLHF. Human evaluations confirm the generated responses' superior relevance and utility.
Introduction
While Large Language Models (LLMs) demonstrate broad capabilities, specialized fields like software development require nuanced understanding that "one-size-fits-all" fine-tuning often misses. Programming queries range from high-level architecture to specific syntax errors, creating a highly heterogeneous data landscape. Furthermore, traditional RLHF is resource-intensive, requiring expert manual labeling. This study addresses these challenges by leveraging the structured, collective intelligence found in online developer communities.
Methodology
The proposed system transforms raw forum data into high-quality training signals through three primary mechanisms.
Thematic Structuring & Classification
To handle domain diversity, questions are classified into eight distinct sub-domains (e.g., Data Science, Web Development). A key innovation is the use of CodeT5 to summarize code snippets into natural language before classification by an E5 encoder, which significantly improves accuracy.
Domain-Specific Adapters
Instead of full-parameter fine-tuning, we utilize Low-Rank Adaptation (LoRA). This allows the base Llama 7B model to dynamically load specialized "adapters" based on the detected topic, ensuring the model applies the most relevant context to the user's query.
Implicit RLHF
The core of this approach is the use of Stack Overflow’s existing voting system as a proxy for human feedback. By transforming community votes into a reward signal, we train a Reward Model (RM) without manual intervention. To improve RM robustness, we employ Paraphrasing Augmentation, generating varied versions of high-quality answers to help the model generalize beyond simple textual matching.
Results and Discussion
Our experiments on a dataset of over 150,000 Python-related questions revealed significant performance gains. The classification-based ensemble approach improved the Rouge metric by 22.5%. The subsequent application of implicit RLHF added an 11.2% boost.
Crucially, we found that traditional metrics like SacreBLEU and BertScore correlate poorly with human judgment in technical domains. In blind human evaluations, the RLHF-tuned model provided relevant and useful answers in 45.8% of cases, significantly outperforming standard supervised fine-tuning (SFT) models. Additionally, through model distillation, we achieved a 44% reduction in inference time with negligible impact on accuracy.
Conclusion
By structuring community data and processing implicit feedback, we can significantly improve PLM performance in complex, heterogeneous domains. This study demonstrates that community "upvotes" are a viable, scalable alternative to manual ranking for RLHF. Future work will focus on extending this methodology to other programming languages and integrating semantic technologies like knowledge graphs to further refine contextual understanding.
Summary updated