{"id":"https://openalex.org/W4406867827","doi":"https://doi.org/10.1145/3705300","title":"Distinguishing LLM-Generated from Human-Written Code by Contrastive Learning","display_name":"Distinguishing LLM-Generated from Human-Written Code by Contrastive Learning","publication_year":2025,"publication_date":"2025-01-27","ids":{"openalex":"https://openalex.org/W4406867827","doi":"https://doi.org/10.1145/3705300"},"language":"en","primary_location":{"id":"doi:10.1145/3705300","is_oa":false,"landing_page_url":"https://doi.org/10.1145/3705300","pdf_url":null,"source":{"id":"https://openalex.org/S142627899","display_name":"ACM Transactions on Software Engineering and Methodology","issn_l":"1049-331X","issn":["1049-331X","1557-7392"],"is_oa":false,"is_in_doaj":false,"is_core":true,"host_organization":"https://openalex.org/P4310319798","host_organization_name":"Association for Computing Machinery","host_organization_lineage":["https://openalex.org/P4310319798"],"host_organization_lineage_names":["Association for Computing Machinery"],"type":"journal"},"license":null,"license_id":null,"version":"publishedVersion","is_accepted":true,"is_published":true,"raw_source_name":"ACM Transactions on Software Engineering and Methodology","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":"https://openalex.org/A5010748209","display_name":"Xiaodan Xu","orcid":"https://orcid.org/0009-0001-4066-0535"},"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":true,"raw_author_name":"Xiaodan Xu","raw_affiliation_strings":["State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China","State Key Laboratory of Blockchain and Data Security, Zhejiang University, China"],"raw_orcid":"https://orcid.org/0009-0001-4066-0535","affiliations":[{"raw_affiliation_string":"State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China","institution_ids":["https://openalex.org/I76130692"]},{"raw_affiliation_string":"State Key Laboratory of Blockchain and Data Security, Zhejiang University, China","institution_ids":["https://openalex.org/I76130692"]}]},{"author_position":"middle","author":{"id":"https://openalex.org/A5102737361","display_name":"Chao Ni","orcid":"https://orcid.org/0000-0002-2906-0598"},"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":"Chao Ni","raw_affiliation_strings":["State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China","State Key Laboratory of Blockchain and Data Security, Zhejiang University, China"],"raw_orcid":"https://orcid.org/0000-0002-2906-0598","affiliations":[{"raw_affiliation_string":"State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China","institution_ids":["https://openalex.org/I76130692"]},{"raw_affiliation_string":"State Key Laboratory of Blockchain and Data Security, Zhejiang University, China","institution_ids":["https://openalex.org/I76130692"]}]},{"author_position":"middle","author":{"id":null,"display_name":"Xinrong Guo","orcid":"https://orcid.org/0009-0000-0499-0222"},"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":"Xinrong Guo","raw_affiliation_strings":["State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China","State Key Laboratory of Blockchain and Data Security, Zhejiang University, China"],"raw_orcid":"https://orcid.org/0009-0000-0499-0222","affiliations":[{"raw_affiliation_string":"State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China","institution_ids":["https://openalex.org/I76130692"]},{"raw_affiliation_string":"State Key Laboratory of Blockchain and Data Security, Zhejiang University, China","institution_ids":["https://openalex.org/I76130692"]}]},{"author_position":"middle","author":{"id":null,"display_name":"Shaoxuan Liu","orcid":"https://orcid.org/0009-0006-6996-9479"},"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":"Shaoxuan Liu","raw_affiliation_strings":["State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China","State Key Laboratory of Blockchain and Data Security, Zhejiang University, China"],"raw_orcid":"https://orcid.org/0009-0006-6996-9479","affiliations":[{"raw_affiliation_string":"State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China","institution_ids":["https://openalex.org/I76130692"]},{"raw_affiliation_string":"State Key Laboratory of Blockchain and Data Security, Zhejiang University, China","institution_ids":["https://openalex.org/I76130692"]}]},{"author_position":"middle","author":{"id":null,"display_name":"Xiaoya Wang","orcid":"https://orcid.org/0009-0007-3706-0663"},"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":"Xiaoya Wang","raw_affiliation_strings":["State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China","State Key Laboratory of Blockchain and Data Security, Zhejiang University, China"],"raw_orcid":"https://orcid.org/0009-0007-3706-0663","affiliations":[{"raw_affiliation_string":"State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China","institution_ids":["https://openalex.org/I76130692"]},{"raw_affiliation_string":"State Key Laboratory of Blockchain and Data Security, Zhejiang University, China","institution_ids":["https://openalex.org/I76130692"]}]},{"author_position":"middle","author":{"id":"https://openalex.org/A5100374023","display_name":"Kui Liu","orcid":"https://orcid.org/0000-0003-0145-615X"},"institutions":[{"id":"https://openalex.org/I2250955327","display_name":"Huawei Technologies (China)","ror":"https://ror.org/00cmhce21","country_code":"CN","type":"company","lineage":["https://openalex.org/I2250955327"]}],"countries":["CN"],"is_corresponding":false,"raw_author_name":"Kui Liu","raw_affiliation_strings":["Software Engineering Application Technology Lab, Huawei, Hangzhou, China","Software Engineering Application Technology Lab, Huawei, China"],"raw_orcid":"https://orcid.org/0000-0003-0145-615X","affiliations":[{"raw_affiliation_string":"Software Engineering Application Technology Lab, Huawei, Hangzhou, China","institution_ids":["https://openalex.org/I2250955327"]},{"raw_affiliation_string":"Software Engineering Application Technology Lab, Huawei, China","institution_ids":["https://openalex.org/I2250955327"]}]},{"author_position":"last","author":{"id":"https://openalex.org/A5101577570","display_name":"Xiaohu Yang","orcid":"https://orcid.org/0000-0003-4111-4189"},"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":"Xiaohu Yang","raw_affiliation_strings":["State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China","State Key Laboratory of Blockchain and Data Security, Zhejiang University, China"],"raw_orcid":"https://orcid.org/0000-0003-4111-4189","affiliations":[{"raw_affiliation_string":"State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China","institution_ids":["https://openalex.org/I76130692"]},{"raw_affiliation_string":"State Key Laboratory of Blockchain and Data Security, Zhejiang University, China","institution_ids":["https://openalex.org/I76130692"]}]}],"institutions":[],"countries_distinct_count":1,"institutions_distinct_count":7,"corresponding_author_ids":["https://openalex.org/A5010748209"],"corresponding_institution_ids":["https://openalex.org/I76130692"],"apc_list":null,"apc_paid":null,"fwci":21.1954,"has_fulltext":false,"cited_by_count":11,"citation_normalized_percentile":{"value":0.9920226,"is_in_top_1_percent":true,"is_in_top_10_percent":true},"cited_by_percentile_year":{"min":98,"max":99},"biblio":{"volume":"34","issue":"4","first_page":"1","last_page":"31"},"is_retracted":false,"is_paratext":false,"is_xpac":false,"primary_topic":{"id":"https://openalex.org/T10181","display_name":"Natural Language Processing Techniques","score":0.9991000294685364,"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"}},"topics":[{"id":"https://openalex.org/T10181","display_name":"Natural Language Processing Techniques","score":0.9991000294685364,"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"}},{"id":"https://openalex.org/T10601","display_name":"Handwritten Text Recognition Techniques","score":0.9785000085830688,"subfield":{"id":"https://openalex.org/subfields/1707","display_name":"Computer Vision and Pattern Recognition"},"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/T10028","display_name":"Topic Modeling","score":0.9772999882698059,"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/computer-science","display_name":"Computer science","score":0.8310010433197021},{"id":"https://openalex.org/keywords/code","display_name":"Code (set theory)","score":0.4517310857772827},{"id":"https://openalex.org/keywords/programming-language","display_name":"Programming language","score":0.4227994978427887},{"id":"https://openalex.org/keywords/artificial-intelligence","display_name":"Artificial intelligence","score":0.3360820710659027},{"id":"https://openalex.org/keywords/natural-language-processing","display_name":"Natural language processing","score":0.3331649899482727}],"concepts":[{"id":"https://openalex.org/C41008148","wikidata":"https://www.wikidata.org/wiki/Q21198","display_name":"Computer science","level":0,"score":0.8310010433197021},{"id":"https://openalex.org/C2776760102","wikidata":"https://www.wikidata.org/wiki/Q5139990","display_name":"Code (set theory)","level":3,"score":0.4517310857772827},{"id":"https://openalex.org/C199360897","wikidata":"https://www.wikidata.org/wiki/Q9143","display_name":"Programming language","level":1,"score":0.4227994978427887},{"id":"https://openalex.org/C154945302","wikidata":"https://www.wikidata.org/wiki/Q11660","display_name":"Artificial intelligence","level":1,"score":0.3360820710659027},{"id":"https://openalex.org/C204321447","wikidata":"https://www.wikidata.org/wiki/Q30642","display_name":"Natural language processing","level":1,"score":0.3331649899482727},{"id":"https://openalex.org/C177264268","wikidata":"https://www.wikidata.org/wiki/Q1514741","display_name":"Set (abstract data type)","level":2,"score":0.0}],"mesh":[],"locations_count":1,"locations":[{"id":"doi:10.1145/3705300","is_oa":false,"landing_page_url":"https://doi.org/10.1145/3705300","pdf_url":null,"source":{"id":"https://openalex.org/S142627899","display_name":"ACM Transactions on Software Engineering and Methodology","issn_l":"1049-331X","issn":["1049-331X","1557-7392"],"is_oa":false,"is_in_doaj":false,"is_core":true,"host_organization":"https://openalex.org/P4310319798","host_organization_name":"Association for Computing Machinery","host_organization_lineage":["https://openalex.org/P4310319798"],"host_organization_lineage_names":["Association for Computing Machinery"],"type":"journal"},"license":null,"license_id":null,"version":"publishedVersion","is_accepted":true,"is_published":true,"raw_source_name":"ACM Transactions on Software Engineering and Methodology","raw_type":"journal-article"}],"best_oa_location":null,"sustainable_development_goals":[],"awards":[{"id":"https://openalex.org/G3041480715","display_name":null,"funder_award_id":"2022J184","funder_id":"https://openalex.org/F4320332587","funder_display_name":"Natural Science Foundation of Ningbo"},{"id":"https://openalex.org/G5088726832","display_name":null,"funder_award_id":"62202419","funder_id":"https://openalex.org/F4320321001","funder_display_name":"National Natural Science Foundation of China"},{"id":"https://openalex.org/G7740246774","display_name":null,"funder_award_id":"226-2022-00064","funder_id":"https://openalex.org/F4320335787","funder_display_name":"Fundamental Research Funds for the Central Universities"}],"funders":[{"id":"https://openalex.org/F4320321001","display_name":"National Natural Science Foundation of China","ror":"https://ror.org/01h0zpd94"},{"id":"https://openalex.org/F4320332587","display_name":"Natural Science Foundation of Ningbo","ror":"https://ror.org/01h0zpd94"},{"id":"https://openalex.org/F4320335787","display_name":"Fundamental Research Funds for the Central Universities","ror":null}],"has_content":{"pdf":false,"grobid_xml":false},"content_urls":null,"referenced_works_count":35,"referenced_works":["https://openalex.org/W1704669313","https://openalex.org/W1964962870","https://openalex.org/W2064675550","https://openalex.org/W2084413241","https://openalex.org/W2913954081","https://openalex.org/W2919115771","https://openalex.org/W2951080837","https://openalex.org/W2963775347","https://openalex.org/W2963993699","https://openalex.org/W2979826702","https://openalex.org/W3098605233","https://openalex.org/W3155146092","https://openalex.org/W3170092793","https://openalex.org/W3177116043","https://openalex.org/W3194346579","https://openalex.org/W3198685994","https://openalex.org/W4205371973","https://openalex.org/W4221166942","https://openalex.org/W4224287853","https://openalex.org/W4226278401","https://openalex.org/W4281763794","https://openalex.org/W4308641610","https://openalex.org/W4308641647","https://openalex.org/W4308641648","https://openalex.org/W4308732630","https://openalex.org/W4312969325","https://openalex.org/W4313590979","https://openalex.org/W4319662928","https://openalex.org/W4320009668","https://openalex.org/W4322631505","https://openalex.org/W4384345694","https://openalex.org/W4385261783","https://openalex.org/W4385477851","https://openalex.org/W4393262489","https://openalex.org/W4394859329"],"related_works":["https://openalex.org/W4391375266","https://openalex.org/W2899084033","https://openalex.org/W2748952813","https://openalex.org/W2390279801","https://openalex.org/W4391913857","https://openalex.org/W2358668433","https://openalex.org/W4396701345","https://openalex.org/W2376932109","https://openalex.org/W2001405890","https://openalex.org/W3204019825"],"abstract_inverted_index":{"Large":[0],"language":[1,75],"models":[2],"(LLMs),":[3],"such":[4,48],"as":[5,49],"ChatGPT":[6],"released":[7],"by":[8,92],"OpenAI,":[9],"have":[10,64],"attracted":[11],"significant":[12],"attention":[13],"from":[14,123,181],"both":[15],"industry":[16],"and":[17,52,58,106,132,143,151,163,175],"academia":[18],"due":[19],"to":[20,24,88],"their":[21,42,185],"demonstrated":[22],"ability":[23],"generate":[25],"high-quality":[26],"content":[27,62,76],"for":[28,72],"various":[29,46],"tasks.":[30],"Despite":[31],"the":[32,79,115,158,167,173],"impressive":[33],"capabilities":[34],"of":[35,82,117,141,166,169,177],"LLMs,":[36],"there":[37],"are":[38,69],"growing":[39],"concerns":[40],"regarding":[41],"potential":[43],"risks":[44],"in":[45],"fields,":[47],"news,":[50],"education,":[51],"software":[53],"engineering.":[54],"Recently,":[55],"several":[56],"commercial":[57],"open":[59],"source":[60],"LLM-generated":[61],"detectors":[63],"been":[65],"proposed,":[66],"which,":[67],"however,":[68],"primarily":[70],"designed":[71],"detecting":[73],"natural":[74],"without":[77],"considering":[78],"specific":[80],"characteristics":[81,168],"program":[83],"code.":[84],"This":[85],"article":[86],"aims":[87],"fill":[89],"this":[90],"gap":[91],"proposing":[93],"a":[94,102,107,129],"novel":[95],"ChatGPT-generated":[96,121,144,170,179,197],"code":[97,122,145,149,154,171,180,183],"detector,":[98],"CodeGPTSensor,":[99],"based":[100],"on":[101,119,157],"contrastive":[103],"learning":[104],"framework":[105],"semantic":[108],"encoder":[109],"built":[110],"with":[111,184],"UniXcoder.":[112],"To":[113],"assess":[114],"effectiveness":[116],"CodeGPTSensor":[118,193],"differentiating":[120],"human-written":[124,142,182],"code,":[125,198],"we":[126],"first":[127],"curate":[128],"large-scale":[130],"Human":[131],"Machine":[133],"comparison":[134],"Corpus":[135],"(HMCorp),":[136],"which":[137],"includes":[138],"550k":[139],"pairs":[140,150],"(i.e.,":[146],"288k":[147],"Python":[148],"222k":[152],"Java":[153],"pairs).":[155],"Based":[156],"HMCorp":[159],"dataset,":[160],"our":[161],"qualitative":[162],"quantitative":[164],"analysis":[165],"reveals":[172],"challenge":[174],"opportunity":[176],"distinguishing":[178],"representative":[186],"features.":[187],"Our":[188],"experimental":[189],"results":[190],"indicate":[191],"that":[192],"can":[194],"effectively":[195],"identify":[196],"outperforming":[199],"all":[200],"selected":[201],"baselines.":[202]},"counts_by_year":[{"year":2026,"cited_by_count":4},{"year":2025,"cited_by_count":7}],"updated_date":"2026-05-21T09:19:25.381259","created_date":"2025-10-10T00:00:00"}
