加载中…
加载中…
A 768-dimensional embedding model for Korean fiction style.
Munche-768 by Baragi AI represents stylistic similarity between Korean fiction passages. It was trained to reduce reliance on names and shared plot content while preserving signals such as sentence rhythm, dialogue balance, paragraph structure, punctuation, and narrative phrasing.
Munche-768 is a rank-32 LoRA adapter for google/embeddinggemma-300m. The base model, pooling module, and dense projections remain frozen.
Related model: Munche-768-AI-Detector applies Munche-768 to Korean genre-fiction dataset triage.
All Korean test sets are separated from training by work and verified author group.
The chart compares the four primary held-out Korean fiction evaluations. Higher scores are better.
| Evaluation | Base EmbeddingGemma | Munche-768 |
|---|---|---|
| Same-work retrieval mAP@R | 56.7% | 84.0% |
| Same-author cross-work retrieval mAP@R | 59.6% | 79.9% |
| Content-hard accuracy | 22.6% | 83.1% |
| Counterfactual ordering accuracy | 0.0% | 79.5% |
| Evaluation | Result | Test size |
|---|---|---|
| Same-work retrieval Hit@1 | 95.6% | 1,089 queries |
| Same-author cross-work retrieval Hit@1 | 88.2% | 348 queries |
| Pseudonym-query retrieval mAP@R | 81.1% | 1,089 queries |
| Strong-format retrieval mAP@R | 68.3% | 1,089 queries |
| PAN21 cross-fandom authorship AUROC | 89.5% | 19,999 pairs |
Same-work retrieval searches for non-overlapping passages from the same work within a same-genre gallery. Same-author cross-work retrieval searches for another work by the same author. Content-hard accuracy requires the correct passage to outrank four content-similar passages from other works. Counterfactual ordering accuracy requires another human passage from the same work to outrank an LLM rewrite that preserves the source content.
Access to the gated EmbeddingGemma base model is required.
pip install torch sentence-transformers peft
from peft import PeftModel
from sentence_transformers import SentenceTransformer
base = SentenceTransformer("google/embeddinggemma-300m")
base[0].auto_model = PeftModel.from_pretrained(
base[0].auto_model,
"Baragi-AI/Munche-768",
)
base.max_seq_length = 2048
texts = [
"첫 번째 한국어 소설 본문",
"두 번째 한국어 소설 본문",
]
embeddings = base.encode(
texts,
normalize_embeddings=True,
convert_to_numpy=True,
)
similarity = embeddings @ embeddings.T
print(embeddings.shape) # (2, 768)
Cosine similarity can be calculated with a dot product when the normalized embeddings returned above are used.
| Property | Value |
|---|---|
| Base model | google/embeddinggemma-300m |
| Output dimension | 768 |
| Maximum input length | 2,048 tokens |
| Adapter | LoRA rank 32, alpha 64, dropout 0.05 |
| Target modules | Attention q/k/v/o and MLP gate/up/down projections |
| Trainable parameters | 8,355,840 |
| Pooling and projection | Original EmbeddingGemma modules, frozen |
| Output normalization | L2 normalization |
The private Korean corpus contains fiction passages with work and verified author-group labels. Raw text, titles, author identities, and source paths are not distributed.
The Korean training relations include:
The model also uses cross-fandom authorship relations reconstructed from PAN fanfiction data and feature-disjoint style relations from SynthSTEL. Korean and English examples are optimized in separate contrastive batches.
Munche-768 is designed for:
A logistic regression probe trained on Munche-768 embeddings achieved an AUROC of 0.967 and balanced accuracy of 91.3% on 190 work-disjoint human and LLM rewrite pairs. Human recall was 95.8%, and LLM rewrite recall was 86.8%. This diagnostic measures linear separation within the evaluated content-preserving rewrite distribution.
Munche-768 is a derivative adapter of EmbeddingGemma and is distributed under the Gemma Terms of Use. Use of the base model requires accepting its access conditions on Hugging Face.
The private Korean training corpus and its source text are not included in this repository.
@software{munche768,
title = {Munche-768: Korean Fiction Style Embedding Model},
author = {Baragi AI},
year = {2026},
url = {https://huggingface.co/Baragi-AI/Munche-768}
}
google/embeddinggemma-300m