코드 서식 지정과 축소가 코드 스타일로메트리(작성자 인식)에 미치는 영향을 평가하는 기계 학습 모델 분류 연구
10_Wiki/Topics
verified
self
Code Stylometry Authorship Attribution
Code Formatting Effects on Stylometry
none
A
0.85
applied
stylometry
authorship-attribution
ml
security
privacy
2026-05-10
pending
language
framework
python
scikit-learn
코드 서식 지정과 축소가 코드 스타일로메트리(작성자 인식)에 미치는 영향을 평가하는 기계 학습 모델 분류 연구
매 한 줄
"매 author 의 의 의 의 fingerprint 의 의 의 의 source code 의 의 의 의 hide 의 의 의 가능 의 X?". 매 code stylometry 의 의 의 author identification 의 의 의 의 의 ML 의 의 의 의 study — 매 formatting (Prettier, Black) 의 의 의 의 minification 의 의 의 의 의 의 author signature 의 의 의 의 의 의 erase 의 의 의 의 가능 의 의 의 평가. 매 2018 Caliskan et al. (USENIX) 의 의 seminal work, 매 2026 — 매 LLM 의 의 의 의 의 의 의 의 attribution + counter-stylometry 의 의 의 의 의 의 advance.
매 핵심
매 Code stylometry 의 의 의 의 의 정의
매 source code 의 의 의 의 의 의 의 author 의 의 의 의 의 의 identify 의 의 의 의 의 의 the discipline.
매 features: 매 layout (whitespace), 매 lexical (variable name), 매 syntactic (AST shape).
매 use case: 매 plagiarism, 매 malware author tracing, 매 OSS contribution forensics.
매 privacy concern: 매 anonymous OSS dev 의 의 의 의 의 의 의 의 의 의 deanonymization 의 의 의 의 의 risk.
매 핵심 paper
Caliskan-Islam et al. (USENIX 2015): "De-anonymizing Programmers via Code Stylometry" — 매 250 author 의 의 95% 의 의 의 의 attribution.
Abuhamad et al. (CCS 2018): "Large-Scale Authorship Attribution of Source Code" — 매 1600 author.
Bogomolov et al. (ICSE 2021): "Authorship Attribution of Source Code: A Language-Agnostic Approach".
매 2026 — 매 LLM-based attribution (Code Llama embeddings, BGE-Code).
매 Feature categories
Category
매 예
매 Format-stable?
Layout
indentation, line length
매 X (formatter 의 의 의 의 의 erase)
Lexical
identifier naming, comment style
매 partial
Syntactic
AST n-grams, control flow
매 stable
Semantic
variable scoping, idioms
매 stable
매 Formatting / minification 의 의 의 의 의 의 effect
Prettier / Black — 매 layout feature 의 의 의 의 의 의 erase. 매 lexical / syntactic 의 의 의 의 의 survive.
Minification — 매 layout + 매 identifier rename → 매 attribution accuracy 의 의 의 의 30-40% 의 의 drop.
AST-based features 의 의 의 의 의 의 robust — 매 Caliskan 2015 의 의 의 의 의 의 main finding.
Counter-stylometry: 매 의도적 의 의 의 의 의 의 obfuscation — 매 attribution 의 의 의 의 의 의 evade 가능.
fromsklearn.ensembleimportRandomForestClassifierfromsklearn.feature_extractionimportDictVectorizerfromsklearn.pipelineimportPipelinepipeline=Pipeline([("vec",DictVectorizer()),("clf",RandomForestClassifier(n_estimators=300,random_state=42)),])X=[extract_features(src)forsrcintrain_sources]y=train_authorspipeline.fit(X,y)# 매 attributionpredicted=pipeline.predict([extract_features(unknown_source)])
매 Format-invariant features (post-Prettier robust)
importblackresults={}forfmt_name,formatterin[("raw",lambdas:s),("black",lambdas:black.format_str(s,mode=black.Mode())),("minified",minify_python),]:formatted_X=[extract_features(formatter(src))forsrcintest_sources]acc=pipeline.score(formatted_X,test_authors)results[fmt_name]=acc# 매 typical: raw 0.93, black 0.78, minified 0.52
매 LLM embedding-based attribution (2026)
fromsentence_transformersimportSentenceTransformermodel=SentenceTransformer("BAAI/bge-code-v1")# 매 author centroidauthor_emb={a:model.encode(srcs).mean(0)fora,srcsintrain_by_author.items()}# 매 nearest centroid attributiondefattribute(src:str)->str:e=model.encode(src)returnmin(author_emb,key=lambdaa:cosine(e,author_emb[a]))
매 Counter-stylometry (defense)
# 매 paraphrase via LLM — 매 author signature 의 의 의 의 의 erasedefanonymize_via_llm(src:str)->str:returnclaude.messages.create(model="claude-opus-4-7",messages=[{"role":"user","content":f"Rewrite this code preserving behavior but in neutral style:\n{src}"}]).content[0].text
매 결정 기준
상황
Approach
매 plagiarism detection
매 AST n-gram + RF
매 malware author tracing
매 binary + assembly stylometry
매 OSS author privacy
매 LLM paraphrase + format normalize
매 large-scale (1000+ authors)
매 deep embedding (BGE-Code)
매 cross-language
매 language-agnostic AST features
기본값: 매 AST + lexical features + Random Forest — 매 baseline 의 의 의 의 의 의 의 의 strong (~90% top-1).
언제: 매 plagiarism detection / forensic investigation / OSS privacy assessment.
언제 X: 매 매 production code review — 매 stylometry 의 의 의 의 의 의 의 X relevant.
❌ 안티패턴
Layout-only features: 매 formatter 의 의 의 의 의 의 의 의 trivial 의 의 의 의 evade.
Single-language model: 매 author 의 의 의 의 의 multi-lang 의 의 의 의 의 — 매 cross-lang feature 의 의 의 필요.
Privacy invasion: 매 anonymous contributor 의 의 의 의 의 의 의 의 의 deanonymize — 매 ethical 의 의 의 issue.
Overfitting to small sample: 매 author 별 의 의 의 의 < 5 sample — 매 unreliable.
🧪 검증 / 중복
Verified — Caliskan-Islam et al. De-anonymizing Programmers (USENIX 2015); Abuhamad et al. (CCS 2018); Bogomolov et al. (ICSE 2021).