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만 개가 넘는 합성 학습 데이터를 만들고, 이를 이용해 전용 검색 모델을 훈련시켰다. 그 결과 기존 범용 모델보다 검색 정확도가 뚜렷하게 높은 모델을 얻었다.
무엇을 했나
실제 포럼 질문과 FastCode 사이트에서 3,413개의 러시아어 질문-1C코드 쌍을 모아 개인정보를 제거한 뒤 공개 벤치마크(1C-Ebench)로 만들었다
공개 깃허브의 1C 코드 78만여 건에 대해 구글의 언어모델(gemma-4-26B-A4B-it)로 러시아어 질문을 자동 생성해 학습용 데이터(784,057개 삼중항)를 만들고, 이를 이용해 deepvk/USER2-base 모델을 미세조정했다
Matryoshka Representation Learning이라는 기법으로 임베딩(문장을 숫자 벡터로 바꾼 것) 벡터의 앞부분만 잘라 써도 성능이 거의 유지되게 만들어, 벡터 저장공간과 계산량을 3분의 1로 줄였다
학습 데이터와 벤치마크 사이에 겹치는 내용이 있는지 감사했고, 겹치는 예시를 모두 제거해도 성능이 떨어지지 않아 결과가 데이터 중복 때문이 아님을 확인했다
최종 모델은 검색 정확도 지표(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.
Table 1: Public resource stack.
Component
Content
Scale
PruhaNLP/1C-Ebench
Test pairs: question → code, subsets forum/fastcode
3,413 pairs
PruhaNLP/1C-RB
Evaluation harness: dense, BM25, metrics
CLI/Python
PruhaNLP/1C-Code-Train
Triplets (q,d+,d−) with PII scrubbing
784,057 triplets
PruhaNLP/USER2-1C-code
Domain-adapted reference bi-encoder
768d, 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.
Table 2: PruhaNLP/1C-Ebench subsets.
Subset
Queries
Share
Source
Characterization
forum
2,883
84.5%
Forum discussions
Long questions, context, errors, inline code
fastcode
530
15.5%
Snippet catalog
Short queries, long ready-to-use snippets
Total
3,413
100%
–
Closed-set, single-gold qrels
Figure 3: nDCG@10 leaderboard on PruhaNLP/1C-Ebench (balanced-subset macro).
Table 3: Train–benchmark overlap audit.
Metric
forum
fastcode
all
Exact match: code
0.10%
0.00%
0.09%
Exact match: question
0.03%
8.68%
1.38%
Exact match: pair
0.00%
0.00%
0.00%
13-gram overlap: code
6.24%
16.23%
7.79%
13-gram overlap: question
0.03%
8.68%
1.38%
Input-only
0.03%
6.60%
1.05%
Label-only
6.24%
14.15%
7.47%
Input-and-label
0.00%
2.08%
0.32%
Any 13-gram dirty flag
6.28%
22.83%
8.85%
Figure 4: Matryoshka truncation: balanced-subset macro nDCG@10 by embedding dimension.
Q: Как обойти ограничения ФО на реквизит в динамическом списке, не трогая константу ФО? Gold: ОтключенныеПоля = Новый Массив; … FO×dynamic-list pattern; little lexical overlap with gold.
Win (fastcode) Ours 1; others >10
Q: Описание строки в таблице значений Gold: ст90 = новый ОписаниеТипов("строка",,Новый КвалификаторыСтроки(90)); Colloquial «описание строки» → type API; lexical baselines miss it.
Fail (fastcode) Ours >10; base 1
Q: Произношение текста голосом Gold: Voice = Новый COMObject("SAPI.SpVoice"); Voice.Speak("Привет!"); Rare COM API; general models recover Speak/SAPI.
Fail (fastcode) Ours 32; base 1
Q: Сжатие длинной Строки Gold: СжатиеДанных = Новый СжатиеДанных(9); …Base64. Short generic title; surface «сжатие»+«строка» wins.
Table 12: MRL truncation on PruhaNLP/1C-Ebench.
Dimension m
macro nDCG@10
Retention
Relative index size
768
0.599
100.0%
1.00×
512
0.600
100.0%
0.67×
384
0.600
100.0%
0.50×
256
0.598
99.9%
0.33×
128
0.584
97.5%
0.17×
64
0.560
93.5%
0.08×
32
0.503
83.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.