We introduce a novel method to enhance cross-language code translation from Fortran to C++ by integrating task-specific embedding alignment into a Retrieval-Augmented Generation (RAG) framework. Unlike conventional retrieval approaches that utilize generic embeddings agnostic to the downstream task, our strategy aligns the retrieval model directly with the objective of maximizing translation quality, as quantified by the CodeBLEU metric. This alignment ensures that the embeddings are semantically and syntactically meaningful for the specific code translation task. Our methodology involves constructing a dataset of 25,000 Fortran code snippets sourced from Stack-V2 dataset and generating their corresponding C++ translations using the LLaMA 3.1-8B language model. We compute pairwise CodeBLEU scores between the generated translations and ground truth examples to capture fine-grained similarities. These scores serve as supervision signals in a contrastive learning framework, where we optimize the embedding model to retrieve Fortran-C++ pairs that are most beneficial for improving the language model's translation performance. By integrating these CodeBLEU-optimized embeddings into the RAG framework, our approach significantly enhances both retrieval accuracy and code generation quality over methods employing generic embeddings. On the HPC Fortran2C++ dataset, our method elevates the average CodeBLEU score from 0.64 to 0.73, achieving a 14% relative improvement. On the Numerical Recipes dataset, we observe an increase from 0.52 to 0.60, marking a 15% relative improvement. Importantly, these gains are realized without any fine-tuning of the language model, underscoring the efficiency and practicality of our approach.
Neural Machine Translation with Contrastive Translation Memories
Peking University(北京大学);Tencent AI Lab(腾讯人工智能实验室);Shandong University(山东大学);Beijing Institute of General Artificial Intelligence(北京通用人工智能研究院);Renmin University of China(中国人民大学)
LEGO-Compiler: Enhancing Neural Compilation Through Translation Composability
SKLP, Institute of Computing Technology, CAS University of Chinese Academy of Sciences, Beijing, China(SKLP,计算技术研究所,中国科学院大学,北京,中国);University of Leeds, UK(利兹大学,英国);Zhongguancun Laboratory, Beijing, China(中关村实验室,北京,中国)
Locate-and-Focus: Enhancing Terminology Translation in Speech Language Models
Department of Digital Media Technology, Xiamen University(厦门大学数字媒体技术系);Tongyi Lab(通义实验室);Soochow University(苏州大学);Key Laboratory of Digital Protection and Intelligent Processing of Intangible Cultural Heritage of Fujian and Taiwan (Xiamen University), Ministry of Culture and Tourism, China(福建省和台湾非物质文化遗产数字化保护与智能处理重点实验室(厦门大学),中华人民共和国文化和旅游部,中国)
ViDove: A Translation Agent System with Multimodal Context and Memory-Augmented Reasoning
Pigeon AI;Carnegie Mellon University(卡内基梅隆大学);Fudan University(复旦大学);University of California San Diego(加利福尼亚大学圣地亚哥分校);University of Toronto(多伦多大学);University of California Irvine(加利福尼亚大学尔湾分校);University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);Institute of Science Tokyo(东京科学研究所);Hong Kong University of Science and Technology(香港科技大学)
ExpertAgent: Enhancing Personalized Education through Dynamic Planning and Retrieval-Augmented Long-Chain Reasoning
Department of Computer Science(计算机科学系);San Francisco State University(旧金山州立大学);Department of Mechanical & Industrial Engineering(机械与工业工程系);Louisiana State University(路易斯安那州立大学)
Enhancing Vulnerability Reports with Automated and Augmented Description Summarization
Department of Computer Science at the University of Central Florida(佛罗里达中央大学计算机科学系);Department of Computer Science at Northeastern Illinois University(北伊利诺伊大学计算机科学系);Department of Computer Science at Qatar University(卡塔尔大学计算机科学系);Ewha Womans University(成均馆大学)
A Query-Aware Multi-Path Knowledge Graph Fusion Approach for Enhancing Retrieval-Augmented Generation in Large Language Models
School of Computer and Communication Engineering, University of Science and Technology Beijing(计算机与通信工程学院,北京科技大学);Blekinge Institute of Technology(布莱金厄学院)
Enhancing Visual Dialog Questioner with Entity-based Strategy Learning and Augmented Guesser
Beijing University of Posts and Telecommunications(北京邮电大学);Pattern Recognition Center, WeChat AI, Tencent, China(腾讯微信AI模式识别中心);Soochow University(苏州大学)
Enhancing Speech-to-Speech Dialogue Modeling with End-to-End Retrieval-Augmented Generation
MoE Key Lab of Artificial Intelligence(人工智能增强实验室);Jiangsu Key Lab of Language Computing(江苏语言计算重点实验室);X-LANCE Lab(X-LANCE实验室);School of Computer Science, Shanghai Jiao Tong University(上海交通大学计算机科学学院);Shanghai Innovation Institute(上海创新研究院);Shanghai Aviation Electric Co., Ltd(上海航空电器有限公司)
RAG-Star: Enhancing Deliberative Reasoning with Retrieval Augmented Verification and Refinement
Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学高瓴人工智能学院);Wuhan University of Science and Technology(武汉科技大学);National University of Singapore(新加坡国立大学);Northeastern University at Qinhuangdao(东北大学秦皇岛分校);BOSS Zhipin(BOSS直聘)
Enhancing textual textbook question answering with large language models and retrieval augmented generation
Faculty of Computing and Information Technology, King Abdulaziz University(阿卜杜勒阿齐兹国王大学计算与信息技术学院);College of Computer and Information Science, Imam Mohammad Ibn Saud Islamic University (IMSIU)(伊玛目穆罕默德·本·沙特伊斯兰大学计算机与信息科学学院);School of Computing, Macquarie University(麦考瑞大学计算学院)