Papers › Efficient and Effective Text Encoding for Chinese LLaMA and Alpaca
Efficient and Effective Text Encoding for Chinese LLaMA and Alpaca
Yiming Cui, Ziqing Yang, Xin Yao
Large Language Models (LLMs), such as ChatGPT and GPT-4, have dramatically transformed natural language processing research and shown promising strides towards Artificial General Intelligence (AGI). Nonetheless, the high costs associated with training and deploying LLMs present substantial obstacles to transparent, accessible academic research. While several large language models, such as LLaMA, have been open-sourced by the community, these predominantly focus on English corpora, limiting their usefulness for other languages. In this paper, we propose a method to augment LLaMA with capabilities for understanding and generating Chinese text and its ability to follow instructions. We achieve this by extending LLaMA's existing vocabulary with an additional 20,000 Chinese tokens, thereby improving its encoding efficiency and semantic understanding of Chinese. We further incorporate secondary pre-training using Chinese data and fine-tune the model with Chinese instruction datasets, significantly enhancing the model's ability to comprehend and execute instructions. Our experimental results indicate that the newly proposed model markedly enhances the original LLaMA's proficiency in understanding and generating Chinese content. Additionally, the results on the C-Eval dataset yield competitive performance among the models with several times the size of ours. We have made our pre-trained models, training scripts, and other resources available through GitHub, fostering open research for our community. Chinese LLaMA series: https://github.com/ymcui/Chinese-LLaMA-Alpaca and Chinese Llama-2 series: https://github.com/ymcui/Chinese-LLaMA-Alpaca-2
In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.
Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.
For agents, on Syntology's MCP service (how to connect):
get_harvested_code_for_paper(arxiv_id="2304.08177")get_code(code_sha256="…")with a sample'scode_sha256from the list belowget_citation_path(paper_1="2304.08177", paper_2="…")with another paper's arXiv id or titleget_concepts_for_paper(arxiv_id="2304.08177")
Code
Syntology 24 code samples: 22 from 6 repositories linked to this paper, 2 identical to code harvested from another paper's repository. Across all 24: 18 ran (of which 0 constructed an object rather than computing a result; 9 with no instrument failure: 1 honoured, 0 violated, 8 with no contract checked; 9 where Syntology's instrument failed) · 6 unverified. Where Syntology's instrument failed: 6 where our contract draft was wrong; 3 where the contract check could not run; failures of Syntology's instrument, not of the code.
By repository: official repository: 5 samples from 2 repositories, 4 ran (1 with no instrument failure; 3 where Syntology's instrument failed); community (archive-listed): 17 samples from 4 repositories, 12 ran (8 with no instrument failure; 4 where Syntology's instrument failed); 2 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.
Levels written between 2026-09-22 and 2026-09-25 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 4 of the 18 samples that ran have no recorded date.
Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.
Code Syntology ran Syntology
24 samples harvested: 18 ran (of which 0 constructed an object rather than computing a result; 9 with no instrument failure: 1 honoured, 0 violated, 8 with no contract checked; 9 where Syntology's instrument failed) · 6 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.
Licence: 2 of the 24 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.
Harvested from 6 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. 2 samples are listed last, in a group without a repository. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.
Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.
Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.
A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.
d2895bdf14e8f94f · report
fixture: signature logits:Tensor/2/float, labels:Tensor/1/int · returned Tensor · level recorded 2026-09-22 a4f5d0414a1cf9c6 · report
fixture: signature k:str/0/str · returned str · level recorded 2026-09-22 census: 6 implementations from 13 papers, 3 distinct outputs across 2 buckets, one shared input per bucket this sample: bucket 2 of 2, arg 1: rank 2, kind float, dtype float32 scripts/merge_llama_with_chinese_lora.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted Apache-2.0 (permissive) ·
8f1a49e9d8b29d83 · report
fixture: signature weight:Tensor/2/float, fan_in_fan_out:bool/0/bool · returned Tensor · level recorded 2026-09-22 5b22827888d475e4 · report
591cff6b55ba6bfb · report
fixture: signature model:callable/0/?, use_gradient_checkpointing:bool/0/bool · returned MockModel · level recorded 2026-09-22 862bec96a19b9582 · report
fixture: signature error:RuntimeError/0/? · returned str · level recorded 2026-09-24 3095c6f9fc06ee03 · report
fixture: signature model_tokenizer:MockTokenizer/0/?, input_shape:tuple/1/int, device:str/0/str · returned dict · level recorded 2026-09-24 0d2323a5d9352647 · report
fixture: signature macs:int/0/int, units:NoneType/0/?, precision:int/0/int · returned str · level recorded 2026-09-25 fce9fc5087d11c5b · report
fixture: signature num:float/0/float, units:NoneType/0/?, precision:int/0/int · returned str · level recorded 2026-09-25 03a510eeef28adc4 · report
fixture: signature func:callable/0/?, funcFlopCompute:callable/0/?, old_functions:dict/0/?, module_flop_count:list/1/list, module_mac_count:list/1/list · returned function · level recorded 2026-09-25 e9d40620ba06c476 · report
25a2892b59109d04 · report
e677c1203f29a49d · report
5805470da16397ec · report
fixture: signature instruction:str/0/str · returned str · level recorded 2026-09-25 9975d177719247f6 · report
fixture: signature instruction:str/0/str · returned str · level recorded 2026-09-24 86f93c0600f3a1fd · report
fixture: signature name:str/0/str · returned str · level recorded 2026-09-25 c5bcf01d18bba63d · report
fixture: signature path:str/0/str · returned dict · level recorded, date not recorded 506e15dcebddded4 · report
fixture: signature instruction:str/0/str · returned str · level recorded 2026-09-22 1d905d8345954c70 · report
fixture: signature filename:str/0/str · returned dict · level recorded 2026-09-22 bda36ad0c44dbd74 · report
fixture: signature data:list/1/dict · returned dict · level recorded, date not recorded 2 samples are identical to code Syntology harvested from another paper's repository; this paper's own copy was not located, so no repository is named and no licence is recorded.
census: 8 implementations from 7 papers, 7 distinct outputs across 6 buckets, one shared input per bucket repository not located ran; the contract check could not run (RAISES) · metamorphic tier: deterministic fingerprinted licence of this copy not recorded ·
8a38d7c525fad8f1 · report
fixture: signature predictions:ndarray/1/int, references:ndarray/1/int, normalize:bool/0/bool, sample_weight:ndarray/1/float · returned dict · level recorded, date not recorded 6b376a0abe58a427 · report
fixture: signature eval_preds:tuple/1/ndarray · returned dict · level recorded, date not recorded Results from the paper archive 2025-07-28
No leaderboard rows for this paper in the archive.
Methods
Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections