Capturing the Effects of Quantization on Trojans in Code LLMs

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Hussain, Aftab, Zarkouei, Sadegh AlMahdi Kazemi, Rabin, Md Rafiqul Islam, Alipour, Mohammad Amin, Lin, Sen, Xu, Bowen
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866916746175184896
author Hussain, Aftab
Zarkouei, Sadegh AlMahdi Kazemi
Rabin, Md Rafiqul Islam
Alipour, Mohammad Amin
Lin, Sen
Xu, Bowen
author_facet Hussain, Aftab
Zarkouei, Sadegh AlMahdi Kazemi
Rabin, Md Rafiqul Islam
Alipour, Mohammad Amin
Lin, Sen
Xu, Bowen
contents Large language models of code exhibit high capability in performing diverse software engineering tasks, such as code translation, defect detection, text-to-code generation, and code summarization. While their ability to enhance developer productivity has spurred widespread use, these models have also seen substantial growth in size, often reaching billions of parameters. This scale demands efficient memory resource usage, prompting practitioners to use optimization techniques such as model quantization. Quantization uses smaller bit representations for the model parameters, reducing the precision of the weights. In this work, we investigate the impact of quantization on the risk of data poisoning attacks on these models, specifically examining whether it mitigates or exacerbates such vulnerabilities. We focus on two large language models, Meta's Llama-2-7b and CodeLlama-7b, applied to an SQL code generation task. Additionally, we introduce a new metric for measuring trojan signals in compromised models. We find that quantization has differing effects on code-generating LLMs: while reducing precision does not significantly alter Llama-2's behavior, it boosts performance and reduces attack success rates in CodeLlama, particularly at 4-bit precision.
format Preprint
id arxiv_https___arxiv_org_abs_2505_14200
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Capturing the Effects of Quantization on Trojans in Code LLMs
Hussain, Aftab
Zarkouei, Sadegh AlMahdi Kazemi
Rabin, Md Rafiqul Islam
Alipour, Mohammad Amin
Lin, Sen
Xu, Bowen
Software Engineering
Large language models of code exhibit high capability in performing diverse software engineering tasks, such as code translation, defect detection, text-to-code generation, and code summarization. While their ability to enhance developer productivity has spurred widespread use, these models have also seen substantial growth in size, often reaching billions of parameters. This scale demands efficient memory resource usage, prompting practitioners to use optimization techniques such as model quantization. Quantization uses smaller bit representations for the model parameters, reducing the precision of the weights. In this work, we investigate the impact of quantization on the risk of data poisoning attacks on these models, specifically examining whether it mitigates or exacerbates such vulnerabilities. We focus on two large language models, Meta's Llama-2-7b and CodeLlama-7b, applied to an SQL code generation task. Additionally, we introduce a new metric for measuring trojan signals in compromised models. We find that quantization has differing effects on code-generating LLMs: while reducing precision does not significantly alter Llama-2's behavior, it boosts performance and reduces attack success rates in CodeLlama, particularly at 4-bit precision.
title Capturing the Effects of Quantization on Trojans in Code LLMs
topic Software Engineering
url https://arxiv.org/abs/2505.14200