매일 아침, 어제의 AI를 한 통으로 정리해 보내드립니다메일로 받아보기

METAL LAB

Natural Language Code Retrieval for 1C:Enterprise: An Open Benchmark and Efficient Bi-Encoder

arXiv:2608.199572026-08-21

러시아어로 1C 회계 소프트웨어 코드를 찾아주는 첫 검색 벤치마크와 전용 AI 모델이 나왔다

1C:Enterprise는 러시아어권에서 널리 쓰이는 기업용 소프트웨어 플랫폼인데, 이 코드를 러시아어 질문으로 검색하는 데 쓸 공개 데이터나 전용 모델이 거의 없었다. 연구진은 3,413개의 실제 질문-코드 쌍으로 이루어진 벤치마크와 78만 개가 넘는 합성 학습 데이터를 만들고, 이를 이용해 전용 검색 모델을 훈련시켰다. 그 결과 기존 범용 모델보다 검색 정확도가 뚜렷하게 높은 모델을 얻었다.

무엇을 했나

  1. 실제 포럼 질문과 FastCode 사이트에서 3,413개의 러시아어 질문-1C코드 쌍을 모아 개인정보를 제거한 뒤 공개 벤치마크(1C-Ebench)로 만들었다
  2. 공개 깃허브의 1C 코드 78만여 건에 대해 구글의 언어모델(gemma-4-26B-A4B-it)로 러시아어 질문을 자동 생성해 학습용 데이터(784,057개 삼중항)를 만들고, 이를 이용해 deepvk/USER2-base 모델을 미세조정했다
  3. Matryoshka Representation Learning이라는 기법으로 임베딩(문장을 숫자 벡터로 바꾼 것) 벡터의 앞부분만 잘라 써도 성능이 거의 유지되게 만들어, 벡터 저장공간과 계산량을 3분의 1로 줄였다
  4. 학습 데이터와 벤치마크 사이에 겹치는 내용이 있는지 감사했고, 겹치는 예시를 모두 제거해도 성능이 떨어지지 않아 결과가 데이터 중복 때문이 아님을 확인했다
  5. 최종 모델은 검색 정확도 지표(nDCG@10)에서 균형평균 0.5992를 기록해 기본 모델(0.4932)과 구글의 embeddinggemma-300m(0.5404)을 모두 앞질렀다
Figure 1: Construction of the public PruhaNLP/1C-Ebench benchmark and the dense-retrieval evaluation pipeline implemented in PruhaNLP/1C-RB.
Figure 1: Construction of the public PruhaNLP/1C-Ebench benchmark and the dense-retrieval evaluation pipeline implemented in PruhaNLP/1C-RB.
Table 1: Public resource stack.
ComponentContentScale
PruhaNLP/1C-EbenchTest pairs: question → code, subsets forum/fastcode3,413 pairs
PruhaNLP/1C-RBEvaluation harness: dense, BM25, metricsCLI/Python
PruhaNLP/1C-Code-TrainTriplets (q,d+,d−) with PII scrubbing784,057 triplets
PruhaNLP/USER2-1C-codeDomain-adapted reference bi-encoder768d, MRL
Figure 2: Construction of PruhaNLP/1C-Code-Train: from filtered public 1C code to synthetic queries, hard-negative triplets, PII scrubbing, and fine-tuning of PruhaNLP/USER2-1C-code.
Figure 2: Construction of PruhaNLP/1C-Code-Train: from filtered public 1C code to synthetic queries, hard-negative triplets, PII scrubbing, and fine-tuning of PruhaNLP/USER2-1C-code.
Table 2: PruhaNLP/1C-Ebench subsets.
SubsetQueriesShareSourceCharacterization
forum2,88384.5%Forum discussionsLong questions, context, errors, inline code
fastcode53015.5%Snippet catalogShort queries, long ready-to-use snippets
Total3,413100%Closed-set, single-gold qrels
Figure 3: nDCG@10 leaderboard on PruhaNLP/1C-Ebench (balanced-subset macro).
Figure 3: nDCG@10 leaderboard on PruhaNLP/1C-Ebench (balanced-subset macro).
Table 3: Train–benchmark overlap audit.
Metricforumfastcodeall
Exact match: code0.10%0.00%0.09%
Exact match: question0.03%8.68%1.38%
Exact match: pair0.00%0.00%0.00%
13-gram overlap: code6.24%16.23%7.79%
13-gram overlap: question0.03%8.68%1.38%
Input-only0.03%6.60%1.05%
Label-only6.24%14.15%7.47%
Input-and-label0.00%2.08%0.32%
Any 13-gram dirty flag6.28%22.83%8.85%
Figure 4: Matryoshka truncation: balanced-subset macro nDCG@10 by embedding dimension.
Figure 4: Matryoshka truncation: balanced-subset macro nDCG@10 by embedding dimension.
Table 4: PruhaNLP/USER2-1C-code configuration.
ParameterValue
Base modeldeepvk/USER2-base
ArchitectureModernBERT/RuModernBERT sentence-transformers encoder
Embedding dimension768
Maximum sequence length8,192
PoolingMean pooling
SimilarityCosine over L2-normalized embeddings
MRL dimensions768, 512, 384, 256, 128, 64, 32
Table 5: LLM-as-a-judge scores for 300 synthetic query–code pairs.
CriterionMeanMedianShare ≥4
Relevance4.33582.0%
Naturalness4.17576.3%
Clarity4.37582.0%
Table 6: Training hyperparameters.
ParameterValue
Training samples784,057 triplets
Batch size / MNRL mini-batch256 / 32
Epochs / steps3 / 9,189
Learning rate2×10−5
LR schedule5% cosine warmup + decay
Max sequence length / precision8,192 / FP16
Seed / hardware / runtime42 / A100 / ≈7.5 h
Table 7: Dense baselines and prompts. Empty means no prompt prefix.
ModelQuery promptDocument prompt
PruhaNLP/USER2-1C-codesearch_querysearch_document
deepvk/USER2-basesearch_querysearch_document
google/embeddinggemma-300mquerydocument
deepvk/USER-bge-m3emptyempty
ibm-granite/granite-embedding-311m-multilingual-r2querydocument
microsoft/harrier-oss-v1-270mweb_search_queryempty
intfloat/multilingual-e5-basequery:passage:
ai-forever/sbert_large_nlu_ruemptyempty
Table 8: nDCG@10 leaderboard on PruhaNLP/1C-Ebench.
RankModelforumfastcodemacromicro
1PruhaNLP/USER2-1C-code0.46170.73660.59920.5044
2google/embeddinggemma-300m0.37200.70800.54040.4242
3deepvk/USER2-base0.36700.61900.49320.4061
4deepvk/USER-bge-m30.34300.63900.49100.3890
5ibm-granite/granite-embedding-311m-multilingual-r20.31900.65100.48460.3706
6microsoft/harrier-oss-v1-270m0.32300.63600.47960.3716
7intfloat/multilingual-e5-base0.30700.55100.42900.3449
8ai-forever/sbert_large_nlu_ru0.09400.07900.08620.0917
BM25Okapi0.28650.33340.30990.2938
RRF(BM25 + PruhaNLP/USER2-1C-code)0.40000.46000.43000.4093
RRF(BM25 + deepvk/USER2-base)0.36200.41950.39080.3709
Table 9: Full @10 metrics for the reference dense model and BM25.
SystemSubsetnDCG@10Recall@10MRR@10
PruhaNLP/USER2-1C-codeforum0.46170.60080.4178
PruhaNLP/USER2-1C-codefastcode0.73660.92080.6774
BM25Okapiforum0.28650.34790.2670
BM25Okapifastcode0.33340.41890.3067
Table 10: Paired-bootstrap nDCG@10 comparisons.
ComparisonΔ95% CI / P
Macro: Ours vs. USER2-base+0.106[0.087, 0.125], P<0.001
Macro: Ours vs. EmbeddingGemma+0.0588[0.042, 0.075], P<0.001
RRF vs. dense (Ours), forum−0.062[−0.075,−0.049], P<0.05
RRF vs. dense (Ours), fastcode−0.277[−0.319,−0.234], P<0.05
RRF vs. dense (Base), forum−0.005[−0.016, 0.006], n.s.
RRF vs. dense (Base), fastcode−0.200[−0.237,−0.164], P<0.05
Table 11: Qualitative wins and failures (original Russian query/code). Gold rank: 1 = best; >10 = outside top-10.
Type / ranksQuery, gold, interpretation
Win (forum) Ours 1; others >10Q: Как обойти ограничения ФО на реквизит в динамическом списке, не трогая константу ФО? Gold: ОтключенныеПоля = Новый Массив; … FO×dynamic-list pattern; little lexical overlap with gold.
Win (fastcode) Ours 1; others >10Q: Описание строки в таблице значений Gold: ст90 = новый ОписаниеТипов("строка",,Новый КвалификаторыСтроки(90)); Colloquial «описание строки» → type API; lexical baselines miss it.
Fail (fastcode) Ours >10; base 1Q: Произношение текста голосом Gold: Voice = Новый COMObject("SAPI.SpVoice"); Voice.Speak("Привет!"); Rare COM API; general models recover Speak/SAPI.
Fail (fastcode) Ours 32; base 1Q: Сжатие длинной Строки Gold: СжатиеДанных = Новый СжатиеДанных(9); …Base64. Short generic title; surface «сжатие»+«строка» wins.
Table 12: MRL truncation on PruhaNLP/1C-Ebench.
Dimension mmacro nDCG@10RetentionRelative index size
7680.599100.0%1.00×
5120.600100.0%0.67×
3840.600100.0%0.50×
2560.59899.9%0.33×
1280.58497.5%0.17×
640.56093.5%0.08×
320.50383.9%0.04×

왜 중요한가

러시아어와 업계 전문용어가 뒤섞인 1C 코드는 지금까지 검색 품질을 검증할 공개 기준조차 없어 관련 AI 도구 개발이 막혀 있었다. 이번 벤치마크와 모델, 학습 데이터가 모두 공개되어 있어, 비영어권·특수 도메인 코드 검색 연구를 시작하려는 누구나 바로 활용할 수 있다.

이 논문의 용어

  • bi-encoder(바이인코더) · 질문과 문서를 각각 독립적으로 벡터로 바꾼 뒤 유사도를 비교하는 검색 모델 구조
  • nDCG@10 · 검색 결과 상위 10개 중 정답이 얼마나 높은 순위에 있는지를 점수화한 검색 품질 지표
  • Matryoshka Representation Learning(MRL) · 하나의 임베딩 벡터에서 앞부분만 잘라도 성능이 유지되도록 훈련하는 기법
  • BM25 · 단어 일치도를 기반으로 문서를 검색하는 전통적인 키워드 검색 알고리즘
  • PII 스크러빙 · 이메일, 전화번호 등 개인식별정보를 자동으로 찾아 가리는 처리

논문 원문 초록 (영문)

Natural language code retrieval is a rapidly evolving task in computer science. However, the 1C:Enterprise ecosystem combines Russian syntax with highly domain-specific terminology, for which open datasets and specialized models have been virtually non-existent. We present a comprehensive pipeline for 1C code retrieval: an open benchmark of 3,413 real-world, PII-scrubbed query-code pairs, a reproducible evaluation harness, and a specialized bi-encoder. To overcome scarce labeled data, we fine-tune on 784,057 synthetic triplets generated by google/gemma-4-26B-A4B-it from public code repositories, using Matryoshka Representation Learning (MRL) and a privacy-aware tokenizer. Because the benchmark subsets differ in size, we report balanced-subset macro, query-weighted micro, and forum-only results. Our model reaches 0.5992 balanced macro nDCG@10, 0.5044 micro, and 0.4617 on forum, versus 0.4932 macro for the baseline architecture and 0.5404 for google/embeddinggemma-300m. Removing every benchmark example flagged by the conservative exact/13-gram overlap audit leaves 0.6011 balanced macro (0.5010 micro), indicating that detected train-benchmark overlap does not explain the headline result. MRL truncation to 256 dimensions preserves 99.9% of retrieval quality while reducing dense-index storage and exact similarity arithmetic by a factor of three.

저자 · Konstantin Chesnokov, Chingiz Mingazov

arXiv에서 원문 보기

최신 논문

논문 전체 보기 →

METAL LAB 최신 기사

그림 출처: Konstantin Chesnokov et al., arXiv:2608.19957, arxiv-nonexclusive