{"id":"https://openalex.org/W7118181520","doi":"https://doi.org/10.1109/tse.2025.3650127","title":"Steer Your Model: Secure Code Generation With Contrastive Decoding","display_name":"Steer Your Model: Secure Code Generation With Contrastive Decoding","publication_year":2026,"publication_date":"2026-01-05","ids":{"openalex":"https://openalex.org/W7118181520","doi":"https://doi.org/10.1109/tse.2025.3650127"},"language":null,"primary_location":{"id":"doi:10.1109/tse.2025.3650127","is_oa":false,"landing_page_url":"https://doi.org/10.1109/tse.2025.3650127","pdf_url":null,"source":{"id":"https://openalex.org/S8351582","display_name":"IEEE Transactions on Software Engineering","issn_l":"0098-5589","issn":["0098-5589","1939-3520","2326-3881"],"is_oa":false,"is_in_doaj":false,"is_core":true,"host_organization":"https://openalex.org/P4310320439","host_organization_name":"IEEE Computer Society","host_organization_lineage":["https://openalex.org/P4310320439","https://openalex.org/P4310319808"],"host_organization_lineage_names":["IEEE Computer Society","Institute of Electrical and Electronics Engineers"],"type":"journal"},"license":null,"license_id":null,"version":"publishedVersion","is_accepted":true,"is_published":true,"raw_source_name":"IEEE Transactions on Software Engineering","raw_type":"journal-article"},"type":"article","indexed_in":["crossref"],"open_access":{"is_oa":false,"oa_status":"closed","oa_url":null,"any_repository_has_fulltext":false},"authorships":[{"author_position":"first","author":{"id":null,"display_name":"Li Huang","orcid":"https://orcid.org/0009-0005-2603-3366"},"institutions":[{"id":"https://openalex.org/I158842170","display_name":"Chongqing University","ror":"https://ror.org/023rhb549","country_code":"CN","type":"education","lineage":["https://openalex.org/I158842170"]}],"countries":["CN"],"is_corresponding":false,"raw_author_name":"Li Huang","raw_affiliation_strings":["School of Big Data and Software Engineering, Chongqing University, Chongqing, China"],"raw_orcid":"https://orcid.org/0009-0005-2603-3366","affiliations":[{"raw_affiliation_string":"School of Big Data and Software Engineering, Chongqing University, Chongqing, China","institution_ids":["https://openalex.org/I158842170"]}]},{"author_position":"middle","author":{"id":"https://openalex.org/A5121968628","display_name":"Meng Yan","orcid":null},"institutions":[{"id":"https://openalex.org/I158842170","display_name":"Chongqing University","ror":"https://ror.org/023rhb549","country_code":"CN","type":"education","lineage":["https://openalex.org/I158842170"]}],"countries":["CN"],"is_corresponding":false,"raw_author_name":"Meng Yan","raw_affiliation_strings":["School of Big Data and Software Engineering, Chongqing University, Chongqing, China"],"raw_orcid":"https://orcid.org/0000-0002-9538-9121","affiliations":[{"raw_affiliation_string":"School of Big Data and Software Engineering, Chongqing University, Chongqing, China","institution_ids":["https://openalex.org/I158842170"]}]},{"author_position":"middle","author":{"id":null,"display_name":"Tao Yin","orcid":"https://orcid.org/0009-0003-8927-6838"},"institutions":[{"id":"https://openalex.org/I158842170","display_name":"Chongqing University","ror":"https://ror.org/023rhb549","country_code":"CN","type":"education","lineage":["https://openalex.org/I158842170"]}],"countries":["CN"],"is_corresponding":false,"raw_author_name":"Tao Yin","raw_affiliation_strings":["School of Big Data and Software Engineering, Chongqing University, Chongqing, China"],"raw_orcid":"https://orcid.org/0009-0003-8927-6838","affiliations":[{"raw_affiliation_string":"School of Big Data and Software Engineering, Chongqing University, Chongqing, China","institution_ids":["https://openalex.org/I158842170"]}]},{"author_position":"middle","author":{"id":"https://openalex.org/A5121940522","display_name":"Weifeng Sun","orcid":null},"institutions":[{"id":"https://openalex.org/I158842170","display_name":"Chongqing University","ror":"https://ror.org/023rhb549","country_code":"CN","type":"education","lineage":["https://openalex.org/I158842170"]}],"countries":["CN"],"is_corresponding":false,"raw_author_name":"Weifeng Sun","raw_affiliation_strings":["School of Big Data and Software Engineering, Chongqing University, Chongqing, China"],"raw_orcid":"https://orcid.org/0000-0001-6013-1369","affiliations":[{"raw_affiliation_string":"School of Big Data and Software Engineering, Chongqing University, Chongqing, China","institution_ids":["https://openalex.org/I158842170"]}]},{"author_position":"middle","author":{"id":"https://openalex.org/A5102825823","display_name":"Zhongxin Liu","orcid":"https://orcid.org/0000-0002-1981-1626"},"institutions":[{"id":"https://openalex.org/I76130692","display_name":"Zhejiang University","ror":"https://ror.org/00a2xv884","country_code":"CN","type":"education","lineage":["https://openalex.org/I76130692"]}],"countries":["CN"],"is_corresponding":false,"raw_author_name":"Zhongxin Liu","raw_affiliation_strings":["State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China"],"raw_orcid":"https://orcid.org/0000-0002-1981-1626","affiliations":[{"raw_affiliation_string":"State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China","institution_ids":["https://openalex.org/I76130692"]}]},{"author_position":"middle","author":{"id":null,"display_name":"Hongyu Zhang","orcid":"https://orcid.org/0000-0002-3063-9425"},"institutions":[{"id":"https://openalex.org/I158842170","display_name":"Chongqing University","ror":"https://ror.org/023rhb549","country_code":"CN","type":"education","lineage":["https://openalex.org/I158842170"]}],"countries":["CN"],"is_corresponding":false,"raw_author_name":"Hongyu Zhang","raw_affiliation_strings":["School of Big Data and Software Engineering, Chongqing University, Chongqing, China"],"raw_orcid":"https://orcid.org/0000-0002-3063-9425","affiliations":[{"raw_affiliation_string":"School of Big Data and Software Engineering, Chongqing University, Chongqing, China","institution_ids":["https://openalex.org/I158842170"]}]},{"author_position":"last","author":{"id":"https://openalex.org/A5081036622","display_name":"David Lo","orcid":"https://orcid.org/0000-0002-4367-7201"},"institutions":[{"id":"https://openalex.org/I79891267","display_name":"Singapore Management University","ror":"https://ror.org/050qmg959","country_code":"SG","type":"education","lineage":["https://openalex.org/I79891267"]}],"countries":["SG"],"is_corresponding":false,"raw_author_name":"David Lo","raw_affiliation_strings":["School of Computing and Information Systems, Singapore Management University, Singapore"],"raw_orcid":"https://orcid.org/0000-0002-4367-7201","affiliations":[{"raw_affiliation_string":"School of Computing and Information Systems, Singapore Management University, Singapore","institution_ids":["https://openalex.org/I79891267"]}]}],"institutions":[],"countries_distinct_count":2,"institutions_distinct_count":3,"corresponding_author_ids":[],"corresponding_institution_ids":[],"apc_list":null,"apc_paid":null,"fwci":13.9797,"has_fulltext":false,"cited_by_count":1,"citation_normalized_percentile":{"value":0.95876153,"is_in_top_1_percent":false,"is_in_top_10_percent":true},"cited_by_percentile_year":{"min":94,"max":97},"biblio":{"volume":"52","issue":"3","first_page":"809","last_page":"834"},"is_retracted":false,"is_paratext":false,"is_xpac":false,"primary_topic":{"id":"https://openalex.org/T11241","display_name":"Advanced Malware Detection Techniques","score":0.531499981880188,"subfield":{"id":"https://openalex.org/subfields/1711","display_name":"Signal Processing"},"field":{"id":"https://openalex.org/fields/17","display_name":"Computer Science"},"domain":{"id":"https://openalex.org/domains/3","display_name":"Physical Sciences"}},"topics":[{"id":"https://openalex.org/T11241","display_name":"Advanced Malware Detection Techniques","score":0.531499981880188,"subfield":{"id":"https://openalex.org/subfields/1711","display_name":"Signal Processing"},"field":{"id":"https://openalex.org/fields/17","display_name":"Computer Science"},"domain":{"id":"https://openalex.org/domains/3","display_name":"Physical Sciences"}},{"id":"https://openalex.org/T10260","display_name":"Software Engineering Research","score":0.15800000727176666,"subfield":{"id":"https://openalex.org/subfields/1710","display_name":"Information Systems"},"field":{"id":"https://openalex.org/fields/17","display_name":"Computer Science"},"domain":{"id":"https://openalex.org/domains/3","display_name":"Physical Sciences"}},{"id":"https://openalex.org/T11689","display_name":"Adversarial Robustness in Machine Learning","score":0.062300000339746475,"subfield":{"id":"https://openalex.org/subfields/1702","display_name":"Artificial Intelligence"},"field":{"id":"https://openalex.org/fields/17","display_name":"Computer Science"},"domain":{"id":"https://openalex.org/domains/3","display_name":"Physical Sciences"}}],"keywords":[{"id":"https://openalex.org/keywords/code","display_name":"Code (set theory)","score":0.5612000226974487},{"id":"https://openalex.org/keywords/decoding-methods","display_name":"Decoding methods","score":0.5532000064849854},{"id":"https://openalex.org/keywords/embedding","display_name":"Embedding","score":0.5249999761581421},{"id":"https://openalex.org/keywords/face","display_name":"Face (sociological concept)","score":0.3555999994277954},{"id":"https://openalex.org/keywords/trace","display_name":"TRACE (psycholinguistics)","score":0.32989999651908875},{"id":"https://openalex.org/keywords/error-detection-and-correction","display_name":"Error detection and correction","score":0.3237999975681305},{"id":"https://openalex.org/keywords/source-code","display_name":"Source code","score":0.32359999418258667}],"concepts":[{"id":"https://openalex.org/C41008148","wikidata":"https://www.wikidata.org/wiki/Q21198","display_name":"Computer science","level":0,"score":0.8899999856948853},{"id":"https://openalex.org/C2776760102","wikidata":"https://www.wikidata.org/wiki/Q5139990","display_name":"Code (set theory)","level":3,"score":0.5612000226974487},{"id":"https://openalex.org/C57273362","wikidata":"https://www.wikidata.org/wiki/Q576722","display_name":"Decoding methods","level":2,"score":0.5532000064849854},{"id":"https://openalex.org/C41608201","wikidata":"https://www.wikidata.org/wiki/Q980509","display_name":"Embedding","level":2,"score":0.5249999761581421},{"id":"https://openalex.org/C199360897","wikidata":"https://www.wikidata.org/wiki/Q9143","display_name":"Programming language","level":1,"score":0.415800005197525},{"id":"https://openalex.org/C80444323","wikidata":"https://www.wikidata.org/wiki/Q2878974","display_name":"Theoretical computer science","level":1,"score":0.3772999942302704},{"id":"https://openalex.org/C2779304628","wikidata":"https://www.wikidata.org/wiki/Q3503480","display_name":"Face (sociological concept)","level":2,"score":0.3555999994277954},{"id":"https://openalex.org/C75291252","wikidata":"https://www.wikidata.org/wiki/Q1315756","display_name":"TRACE (psycholinguistics)","level":2,"score":0.32989999651908875},{"id":"https://openalex.org/C113775141","wikidata":"https://www.wikidata.org/wiki/Q428691","display_name":"Computer engineering","level":1,"score":0.3246000111103058},{"id":"https://openalex.org/C103088060","wikidata":"https://www.wikidata.org/wiki/Q1062839","display_name":"Error detection and correction","level":2,"score":0.3237999975681305},{"id":"https://openalex.org/C43126263","wikidata":"https://www.wikidata.org/wiki/Q128751","display_name":"Source code","level":2,"score":0.32359999418258667},{"id":"https://openalex.org/C121822524","wikidata":"https://www.wikidata.org/wiki/Q5157582","display_name":"Computer security model","level":2,"score":0.32260000705718994},{"id":"https://openalex.org/C106487976","wikidata":"https://www.wikidata.org/wiki/Q685816","display_name":"Matrix (chemical analysis)","level":2,"score":0.31619998812675476},{"id":"https://openalex.org/C185798385","wikidata":"https://www.wikidata.org/wiki/Q1161707","display_name":"Benchmark (surveying)","level":2,"score":0.31279999017715454},{"id":"https://openalex.org/C2780451532","wikidata":"https://www.wikidata.org/wiki/Q759676","display_name":"Task (project management)","level":2,"score":0.30790001153945923},{"id":"https://openalex.org/C2779696439","wikidata":"https://www.wikidata.org/wiki/Q7512811","display_name":"Signature (topology)","level":2,"score":0.3000999987125397},{"id":"https://openalex.org/C133162039","wikidata":"https://www.wikidata.org/wiki/Q1061077","display_name":"Code generation","level":3,"score":0.2870999872684479},{"id":"https://openalex.org/C42383842","wikidata":"https://www.wikidata.org/wiki/Q193076","display_name":"Functional programming","level":2,"score":0.2669999897480011},{"id":"https://openalex.org/C120314980","wikidata":"https://www.wikidata.org/wiki/Q180634","display_name":"Distributed computing","level":1,"score":0.26570001244544983},{"id":"https://openalex.org/C42058472","wikidata":"https://www.wikidata.org/wiki/Q810214","display_name":"Base (topology)","level":2,"score":0.2651999890804291}],"mesh":[],"locations_count":1,"locations":[{"id":"doi:10.1109/tse.2025.3650127","is_oa":false,"landing_page_url":"https://doi.org/10.1109/tse.2025.3650127","pdf_url":null,"source":{"id":"https://openalex.org/S8351582","display_name":"IEEE Transactions on Software Engineering","issn_l":"0098-5589","issn":["0098-5589","1939-3520","2326-3881"],"is_oa":false,"is_in_doaj":false,"is_core":true,"host_organization":"https://openalex.org/P4310320439","host_organization_name":"IEEE Computer Society","host_organization_lineage":["https://openalex.org/P4310320439","https://openalex.org/P4310319808"],"host_organization_lineage_names":["IEEE Computer Society","Institute of Electrical and Electronics Engineers"],"type":"journal"},"license":null,"license_id":null,"version":"publishedVersion","is_accepted":true,"is_published":true,"raw_source_name":"IEEE Transactions on Software Engineering","raw_type":"journal-article"}],"best_oa_location":null,"sustainable_development_goals":[],"awards":[{"id":"https://openalex.org/G1959641361","display_name":null,"funder_award_id":"2023CDJKYJH013","funder_id":"https://openalex.org/F4320335787","funder_display_name":"Fundamental Research Funds for the Central Universities"},{"id":"https://openalex.org/G6572571148","display_name":null,"funder_award_id":"62372071","funder_id":"https://openalex.org/F4320321001","funder_display_name":"National Natural Science Foundation of China"}],"funders":[{"id":"https://openalex.org/F4320321001","display_name":"National Natural Science Foundation of China","ror":"https://ror.org/01h0zpd94"},{"id":"https://openalex.org/F4320335787","display_name":"Fundamental Research Funds for the Central Universities","ror":null}],"has_content":{"grobid_xml":false,"pdf":false},"content_urls":null,"referenced_works_count":34,"referenced_works":["https://openalex.org/W3134686229","https://openalex.org/W3170092793","https://openalex.org/W3191444546","https://openalex.org/W3198685994","https://openalex.org/W3199958362","https://openalex.org/W4206251287","https://openalex.org/W4220988989","https://openalex.org/W4221144473","https://openalex.org/W4221166942","https://openalex.org/W4225108562","https://openalex.org/W4252326246","https://openalex.org/W4288057765","https://openalex.org/W4308627645","https://openalex.org/W4311887664","https://openalex.org/W4313547549","https://openalex.org/W4320560161","https://openalex.org/W4384345708","https://openalex.org/W4385245566","https://openalex.org/W4388858772","https://openalex.org/W4389519352","https://openalex.org/W4389520771","https://openalex.org/W4391307510","https://openalex.org/W4396790452","https://openalex.org/W4401042596","https://openalex.org/W4402457779","https://openalex.org/W4402671235","https://openalex.org/W4403747722","https://openalex.org/W4404782576","https://openalex.org/W4404784442","https://openalex.org/W4406688098","https://openalex.org/W4412887834","https://openalex.org/W7124846869","https://openalex.org/W7128191878","https://openalex.org/W7133198585"],"related_works":[],"abstract_inverted_index":{"Large":[0],"Language":[1],"Models":[2],"(LLMs)":[3],"specialized":[4],"in":[5,11,30],"code":[6,17,25,78],"have":[7],"demonstrated":[8],"impressive":[9],"capabilities":[10],"various":[12],"programming":[13],"tasks":[14],"such":[15],"as":[16],"generation.":[18,79],"However,":[19],"these":[20,52,65],"models":[21,105],"often":[22],"generate":[23],"vulnerable":[24],"due":[26],"to":[27,50],"inherent":[28],"flaws":[29],"training":[31],"datasets":[32],"derived":[33],"from":[34],"large-scale,":[35],"unfiltered":[36],"open-source":[37],"repositories.":[38],"Existing":[39],"methods":[40],"like":[41],"SVEN":[42],"(prefix":[43],"tuning)":[44],"and":[45,75,130,141,150,175,190],"CoSec":[46],"(supervised":[47],"co-decoding)":[48],"attempt":[49],"address":[51],"risks":[53],"but":[54],"face":[55],"challenges":[56],"with":[57,128],"transferability":[58],"or":[59],"inflexible":[60],"security":[61,90,132,139,156,165],"constraints.":[62],"To":[63],"mitigate":[64],"issues,":[66],"we":[67,86,113],"propose":[68],"SCoDE,":[69],"a":[70,88,115],"two-stage":[71],"approach":[72],"for":[73],"secure":[74],"functionally":[76],"correct":[77],"After":[80],"an":[81],"initial":[82],"functional":[83,126,159,180],"tuning":[84],"phase,":[85],"integrate":[87],"plug-andplay":[89],"steering":[91,133],"matrix":[92,100],"at":[93],"the":[94,123,169,195],"model\u2019s":[95,125],"output":[96],"embedding":[97],"layer.":[98],"This":[99],"can":[101],"be":[102],"transferred":[103],"across":[104],"without":[106],"modifying":[107],"their":[108],"original":[109,170,196],"weights.":[110],"During":[111],"inference,":[112],"introduce":[114],"novel":[116],"contrastive":[117],"decoding":[118],"mechanism":[119],"that":[120,153],"adaptively":[121],"balances":[122],"base":[124],"logits":[127],"positive":[129],"negative":[131],"signals.":[134],"Extensive":[135],"experiments":[136],"on":[137,188,192],"60":[138],"scenarios":[140],"two":[142],"standard":[143],"benchmarks":[144],"(HumanEval,":[145],"MBPP)":[146],"using":[147],"StarCoder,":[148],"Qwen2.5-Coder,":[149],"CodeLlama":[151],"demonstrate":[152],"SCoDE":[154,163],"enhances":[155],"while":[157],"maintaining":[158],"correctness.":[160],"On":[161],"average,":[162],"improves":[164],"by":[166],"28.09%":[167],"over":[168,173,177,194],"models,":[171],"12.07%":[172],"CoSec,":[174],"4.82%":[176],"SVEN.":[178],"For":[179],"correctness,":[181],"it":[182],"achieves":[183],"average":[184],"gains":[185],"of":[186],"55.03%":[187],"HumanEval":[189],"41.81%":[191],"MBPP":[193],"models.":[197]},"counts_by_year":[{"year":2026,"cited_by_count":1}],"updated_date":"2026-03-20T20:47:17.329874","created_date":"2026-01-05T00:00:00"}
