Update Model Card with comprehensive English documentation
Browse files
README.md
CHANGED
|
@@ -1,209 +1,331 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
| 3 |
library_name: peft
|
| 4 |
-
pipeline_tag: text-generation
|
| 5 |
tags:
|
| 6 |
-
-
|
| 7 |
-
-
|
| 8 |
-
-
|
| 9 |
-
-
|
| 10 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
## Model Details
|
| 20 |
-
|
| 21 |
-
### Model Description
|
| 22 |
-
|
| 23 |
-
<!-- Provide a longer summary of what this model is. -->
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
- **Developed by:** [More Information Needed]
|
| 28 |
-
- **Funded by [optional]:** [More Information Needed]
|
| 29 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 30 |
-
- **Model type:** [More Information Needed]
|
| 31 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 32 |
-
- **License:** [More Information Needed]
|
| 33 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 34 |
-
|
| 35 |
-
### Model Sources [optional]
|
| 36 |
-
|
| 37 |
-
<!-- Provide the basic links for the model. -->
|
| 38 |
-
|
| 39 |
-
- **Repository:** [More Information Needed]
|
| 40 |
-
- **Paper [optional]:** [More Information Needed]
|
| 41 |
-
- **Demo [optional]:** [More Information Needed]
|
| 42 |
-
|
| 43 |
-
## Uses
|
| 44 |
|
| 45 |
-
|
| 46 |
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
-
|
| 50 |
|
| 51 |
-
|
| 52 |
|
| 53 |
-
|
| 54 |
|
| 55 |
-
|
| 56 |
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
| 62 |
-
|
| 63 |
-
[More Information Needed]
|
| 64 |
-
|
| 65 |
-
## Bias, Risks, and Limitations
|
| 66 |
-
|
| 67 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 68 |
-
|
| 69 |
-
[More Information Needed]
|
| 70 |
-
|
| 71 |
-
### Recommendations
|
| 72 |
-
|
| 73 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 74 |
-
|
| 75 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 76 |
-
|
| 77 |
-
## How to Get Started with the Model
|
| 78 |
-
|
| 79 |
-
Use the code below to get started with the model.
|
| 80 |
-
|
| 81 |
-
[More Information Needed]
|
| 82 |
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
-
###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
-
|
| 88 |
|
| 89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
-
### Training
|
| 92 |
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
-
|
| 96 |
|
| 97 |
-
|
| 98 |
|
|
|
|
|
|
|
|
|
|
| 99 |
|
| 100 |
-
|
| 101 |
|
| 102 |
-
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
|
| 106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
|
| 108 |
-
|
|
|
|
|
|
|
| 109 |
|
| 110 |
-
|
|
|
|
| 111 |
|
| 112 |
-
|
| 113 |
|
| 114 |
-
|
| 115 |
|
| 116 |
-
|
| 117 |
|
| 118 |
-
|
| 119 |
|
| 120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
|
| 122 |
-
|
|
|
|
|
|
|
|
|
|
| 123 |
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
[More Information Needed]
|
| 127 |
|
| 128 |
-
|
|
|
|
|
|
|
|
|
|
| 129 |
|
| 130 |
-
|
| 131 |
|
| 132 |
-
|
| 133 |
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
|
| 136 |
-
|
| 137 |
|
| 138 |
-
|
|
|
|
|
|
|
| 139 |
|
|
|
|
| 140 |
|
|
|
|
| 141 |
|
| 142 |
-
|
|
|
|
|
|
|
|
|
|
| 143 |
|
| 144 |
-
|
| 145 |
|
| 146 |
-
|
| 147 |
|
| 148 |
-
|
|
|
|
|
|
|
|
|
|
| 149 |
|
| 150 |
-
|
|
|
|
|
|
|
|
|
|
| 151 |
|
| 152 |
-
|
| 153 |
|
| 154 |
-
-
|
| 155 |
-
-
|
| 156 |
-
-
|
| 157 |
-
-
|
| 158 |
-
-
|
|
|
|
| 159 |
|
| 160 |
-
##
|
| 161 |
|
| 162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
|
| 164 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
|
| 166 |
-
|
| 167 |
|
| 168 |
-
|
| 169 |
|
| 170 |
-
|
|
|
|
|
|
|
| 171 |
|
| 172 |
-
|
| 173 |
|
| 174 |
-
|
|
|
|
|
|
|
|
|
|
| 175 |
|
| 176 |
-
|
| 177 |
|
| 178 |
-
|
| 179 |
|
| 180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
|
| 182 |
-
|
| 183 |
|
| 184 |
-
|
|
|
|
|
|
|
| 185 |
|
| 186 |
-
|
| 187 |
|
| 188 |
-
|
|
|
|
|
|
|
| 189 |
|
| 190 |
-
##
|
| 191 |
|
| 192 |
-
|
|
|
|
| 193 |
|
| 194 |
-
|
| 195 |
|
| 196 |
-
|
| 197 |
|
| 198 |
-
|
|
|
|
|
|
|
|
|
|
| 199 |
|
| 200 |
-
|
| 201 |
|
| 202 |
-
|
| 203 |
|
| 204 |
-
|
| 205 |
|
| 206 |
-
|
| 207 |
-
### Framework versions
|
| 208 |
|
| 209 |
-
- PEFT 0.18.0
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- ko
|
| 4 |
+
license: llama3
|
| 5 |
library_name: peft
|
|
|
|
| 6 |
tags:
|
| 7 |
+
- patent
|
| 8 |
+
- legal
|
| 9 |
+
- qa
|
| 10 |
+
- qlora
|
| 11 |
+
- law
|
| 12 |
+
- korean
|
| 13 |
+
- intellectual-property
|
| 14 |
+
- trademark
|
| 15 |
+
- llama-3
|
| 16 |
+
base_model: MLP-KTLim/llama-3-Korean-Bllossom-8B
|
| 17 |
+
datasets:
|
| 18 |
+
- custom
|
| 19 |
+
metrics:
|
| 20 |
+
- accuracy
|
| 21 |
+
- perplexity
|
| 22 |
+
pipeline_tag: text-generation
|
| 23 |
+
model-index:
|
| 24 |
+
- name: patent-qa-llama3-qlora
|
| 25 |
+
results:
|
| 26 |
+
- task:
|
| 27 |
+
type: text-generation
|
| 28 |
+
name: Text Generation
|
| 29 |
+
dataset:
|
| 30 |
+
name: Korean Patent Decision QA
|
| 31 |
+
type: custom
|
| 32 |
+
metrics:
|
| 33 |
+
- type: token_accuracy
|
| 34 |
+
value: 0.810
|
| 35 |
+
name: Token Accuracy
|
| 36 |
+
- type: loss
|
| 37 |
+
value: 0.651
|
| 38 |
+
name: Validation Loss
|
| 39 |
+
- type: entropy
|
| 40 |
+
value: 0.665
|
| 41 |
+
name: Entropy
|
| 42 |
---
|
| 43 |
|
| 44 |
+
# Korean Patent QA - LLaMA-3 QLoRA Adapter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
+
<div align="center">
|
| 47 |
|
| 48 |
+
[](https://huggingface.co/tree193nn/patent-qa-llama3-qlora)
|
| 49 |
+
[](https://github.com/CocoaSoymilk/patent-qa-llama3-qlora)
|
| 50 |
+
[](https://ai.meta.com/llama/)
|
| 51 |
+
[](https://en.wikipedia.org/wiki/Korean_language)
|
| 52 |
|
| 53 |
+
</div>
|
| 54 |
|
| 55 |
+
## Model Description
|
| 56 |
|
| 57 |
+
This is a **QLoRA adapter** for [LLaMA-3-Korean-Bllossom-8B](https://huggingface.co/MLP-KTLim/llama-3-Korean-Bllossom-8B), fine-tuned on **8,502 Korean patent and trademark decision documents** from the Korean Intellectual Property Tribunal. The model specializes in answering questions about Korean patent law, trademark law, and design rights with high accuracy and confidence.
|
| 58 |
|
| 59 |
+
### Key Features
|
| 60 |
|
| 61 |
+
- π― **81% Token Accuracy** on validation set
|
| 62 |
+
- π **Low Entropy (0.665)** indicating confident predictions
|
| 63 |
+
- πΎ **Memory Efficient** using QLoRA (4-bit quantization)
|
| 64 |
+
- ποΈ **Legal Domain Expertise** in intellectual property law
|
| 65 |
+
- π°π· **Korean Language** optimized for Korean legal terminology
|
| 66 |
|
| 67 |
+
## Model Details
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
+
### Base Model
|
| 70 |
+
|
| 71 |
+
- **Model**: [MLP-KTLim/llama-3-Korean-Bllossom-8B](https://huggingface.co/MLP-KTLim/llama-3-Korean-Bllossom-8B)
|
| 72 |
+
- **Architecture**: LLaMA-3
|
| 73 |
+
- **Parameters**: 8 Billion
|
| 74 |
+
- **Language**: Korean
|
| 75 |
+
|
| 76 |
+
### Training
|
| 77 |
+
|
| 78 |
+
- **Method**: QLoRA (Quantized Low-Rank Adaptation)
|
| 79 |
+
- **Quantization**: 4-bit (NF4) with double quantization
|
| 80 |
+
- **LoRA Rank**: 16
|
| 81 |
+
- **LoRA Alpha**: 32
|
| 82 |
+
- **Target Modules**: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
|
| 83 |
+
- **Training Time**: ~7.5 hours (3 epochs)
|
| 84 |
+
- **GPU**: NVIDIA GPU with CUDA support
|
| 85 |
|
| 86 |
+
### Dataset
|
| 87 |
+
|
| 88 |
+
- **Source**: Korean Intellectual Property Tribunal Decision Documents
|
| 89 |
+
- **Size**: 8,502 QA pairs
|
| 90 |
+
- **Split**: 90% train (7,651), 10% validation (851)
|
| 91 |
+
- **Domain**: Patent Law, Trademark Law, Design Rights
|
| 92 |
+
- **Format**: Question-Answer pairs with legal citations
|
| 93 |
+
- **Language**: Korean
|
| 94 |
|
| 95 |
+
## Performance
|
| 96 |
|
| 97 |
+
| Metric | Value | Description |
|
| 98 |
+
|--------|-------|-------------|
|
| 99 |
+
| Token Accuracy | 81.0% | Percentage of correctly predicted tokens |
|
| 100 |
+
| Validation Loss | 0.651 | Cross-entropy loss on validation set |
|
| 101 |
+
| Entropy | 0.665 | Low entropy indicates confident predictions |
|
| 102 |
+
| Training Loss | 0.494 | Final training loss (epoch 3) |
|
| 103 |
|
| 104 |
+
### Training Curve
|
| 105 |
|
| 106 |
+
The model showed consistent improvement across 3 epochs:
|
| 107 |
+
- **Epoch 1**: Loss 0.777 β 0.612, Accuracy 78.2% β 80.2%
|
| 108 |
+
- **Epoch 2**: Loss 0.589 β 0.480, Accuracy 80.9% β 81.0%
|
| 109 |
+
- **Epoch 3**: Loss stabilized at 0.494, Accuracy maintained at 81.0%
|
| 110 |
|
| 111 |
+
## Usage
|
| 112 |
|
| 113 |
+
### Installation
|
| 114 |
|
| 115 |
+
```bash
|
| 116 |
+
pip install torch transformers peft bitsandbytes accelerate
|
| 117 |
+
```
|
| 118 |
|
| 119 |
+
### Quick Start
|
| 120 |
|
| 121 |
+
```python
|
| 122 |
+
import torch
|
| 123 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
|
| 124 |
+
from peft import PeftModel
|
| 125 |
|
| 126 |
+
# Configuration for 4-bit quantization
|
| 127 |
+
bnb_config = BitsAndBytesConfig(
|
| 128 |
+
load_in_4bit=True,
|
| 129 |
+
bnb_4bit_use_double_quant=True,
|
| 130 |
+
bnb_4bit_quant_type="nf4",
|
| 131 |
+
bnb_4bit_compute_dtype=torch.bfloat16
|
| 132 |
+
)
|
| 133 |
|
| 134 |
+
# Load base model
|
| 135 |
+
base_model_name = "MLP-KTLim/llama-3-Korean-Bllossom-8B"
|
| 136 |
+
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
|
| 137 |
+
base_model = AutoModelForCausalLM.from_pretrained(
|
| 138 |
+
base_model_name,
|
| 139 |
+
quantization_config=bnb_config,
|
| 140 |
+
device_map="auto",
|
| 141 |
+
torch_dtype=torch.bfloat16,
|
| 142 |
+
)
|
| 143 |
|
| 144 |
+
# Load LoRA adapter
|
| 145 |
+
model = PeftModel.from_pretrained(base_model, "tree193nn/patent-qa-llama3-qlora")
|
| 146 |
+
model.eval()
|
| 147 |
|
| 148 |
+
# Inference
|
| 149 |
+
question = "μνκΆμ 보νΈκΈ°κ°μ μΌλ§λ λλμ?"
|
| 150 |
|
| 151 |
+
prompt = f"""<|begin_of_text|><|start_header_id|>system<|end_header_id|>
|
| 152 |
|
| 153 |
+
λΉμ μ μ§μμ¬μ°κΆλ² μ λ¬Έκ°μ
λλ€. νΉν λ° μν κ΄λ ¨ λ²λ₯ μ§λ¬Έμ λν΄ μ ννκ³ μμΈν λ΅λ³μ μ 곡ν΄μ£ΌμΈμ.<|eot_id|><|start_header_id|>user<|end_header_id|>
|
| 154 |
|
| 155 |
+
{question}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
| 156 |
|
| 157 |
+
"""
|
| 158 |
|
| 159 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 160 |
+
outputs = model.generate(
|
| 161 |
+
**inputs,
|
| 162 |
+
max_new_tokens=256,
|
| 163 |
+
temperature=0.7,
|
| 164 |
+
top_p=0.9,
|
| 165 |
+
do_sample=True,
|
| 166 |
+
pad_token_id=tokenizer.eos_token_id,
|
| 167 |
+
)
|
| 168 |
+
answer = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 169 |
+
print(answer)
|
| 170 |
+
```
|
| 171 |
+
|
| 172 |
+
### Example Questions
|
| 173 |
+
|
| 174 |
+
```python
|
| 175 |
+
questions = [
|
| 176 |
+
"μνκΆμ 보νΈκΈ°κ°μ μΌλ§λ λλμ?", # How long is trademark protection?
|
| 177 |
+
"νΉν μΆμ μ νμν μλ₯λ 무μμΈκ°μ?", # What documents are needed for patent filing?
|
| 178 |
+
"λμμΈκΆκ³Ό μ μκΆμ μ°¨μ΄λ 무μμΈκ°μ?", # What's the difference between design rights and copyright?
|
| 179 |
+
]
|
| 180 |
+
```
|
| 181 |
+
|
| 182 |
+
## Intended Use
|
| 183 |
+
|
| 184 |
+
### Primary Use Cases
|
| 185 |
|
| 186 |
+
β
**Question Answering** about Korean intellectual property law
|
| 187 |
+
β
**Legal Research** assistance for patent and trademark matters
|
| 188 |
+
β
**Educational Tool** for learning Korean IP law
|
| 189 |
+
β
**Information Retrieval** from patent decision documents
|
| 190 |
|
| 191 |
+
### Out-of-Scope Use
|
|
|
|
|
|
|
| 192 |
|
| 193 |
+
β **Legal Advice**: This model should NOT be used as a substitute for professional legal counsel
|
| 194 |
+
β **Official Decisions**: Outputs are not legally binding
|
| 195 |
+
β **Non-Korean Languages**: Optimized for Korean only
|
| 196 |
+
β **General Purpose QA**: Specializes in IP law, may not perform well on general topics
|
| 197 |
|
| 198 |
+
## Limitations
|
| 199 |
|
| 200 |
+
### Known Limitations
|
| 201 |
|
| 202 |
+
1. **Temporal Limitation**: Training data is from before 2024; recent legal changes may not be reflected
|
| 203 |
+
2. **Domain Specificity**: Performs best on patent/trademark law; limited on other legal areas
|
| 204 |
+
3. **Language**: Optimized for Korean; English or other languages not supported
|
| 205 |
+
4. **Hallucination Risk**: May generate plausible but incorrect legal interpretations
|
| 206 |
+
5. **Context Length**: Limited to 2048 tokens due to training configuration
|
| 207 |
|
| 208 |
+
### Bias and Fairness
|
| 209 |
|
| 210 |
+
- **Training Data Bias**: Reflects biases present in Korean Intellectual Property Tribunal decisions
|
| 211 |
+
- **Geographic Focus**: Specific to Korean law; not applicable to other jurisdictions
|
| 212 |
+
- **Language Bias**: Korean legal terminology heavily featured
|
| 213 |
|
| 214 |
+
## Ethical Considerations
|
| 215 |
|
| 216 |
+
β οΈ **Important Notice**: This model is intended for research and educational purposes only. Users should:
|
| 217 |
|
| 218 |
+
- **Verify Information**: Always cross-reference with official legal sources
|
| 219 |
+
- **Seek Professional Advice**: Consult qualified legal professionals for actual cases
|
| 220 |
+
- **Understand Limitations**: Recognize the model's domain and temporal constraints
|
| 221 |
+
- **Use Responsibly**: Do not use for misleading or fraudulent purposes
|
| 222 |
|
| 223 |
+
## Technical Specifications
|
| 224 |
|
| 225 |
+
### Hardware Requirements
|
| 226 |
|
| 227 |
+
**Minimum**:
|
| 228 |
+
- GPU: 16GB VRAM (e.g., NVIDIA RTX 4080, A4000)
|
| 229 |
+
- RAM: 32GB
|
| 230 |
+
- Storage: 20GB (base model + adapter)
|
| 231 |
|
| 232 |
+
**Recommended**:
|
| 233 |
+
- GPU: 24GB+ VRAM (e.g., NVIDIA RTX 4090, A5000, A6000)
|
| 234 |
+
- RAM: 64GB
|
| 235 |
+
- Storage: 30GB
|
| 236 |
|
| 237 |
+
### Software Requirements
|
| 238 |
|
| 239 |
+
- Python 3.8+
|
| 240 |
+
- PyTorch 2.0+
|
| 241 |
+
- Transformers 4.38.0+
|
| 242 |
+
- PEFT 0.8.0+
|
| 243 |
+
- BitsAndBytes 0.42.0+
|
| 244 |
+
- CUDA 11.8+ or 12.0+
|
| 245 |
|
| 246 |
+
## Training Hyperparameters
|
| 247 |
|
| 248 |
+
```yaml
|
| 249 |
+
# QLoRA Configuration
|
| 250 |
+
lora_r: 16
|
| 251 |
+
lora_alpha: 32
|
| 252 |
+
lora_dropout: 0.05
|
| 253 |
+
quantization: 4-bit (NF4)
|
| 254 |
|
| 255 |
+
# Training Configuration
|
| 256 |
+
epochs: 3
|
| 257 |
+
batch_size: 2 (per device)
|
| 258 |
+
gradient_accumulation_steps: 8
|
| 259 |
+
effective_batch_size: 16
|
| 260 |
+
learning_rate: 2e-4
|
| 261 |
+
lr_scheduler: cosine
|
| 262 |
+
warmup_ratio: 0.03
|
| 263 |
+
weight_decay: 0.01
|
| 264 |
+
optimizer: paged_adamw_32bit
|
| 265 |
+
max_seq_length: 2048
|
| 266 |
+
```
|
| 267 |
|
| 268 |
+
## Evaluation
|
| 269 |
|
| 270 |
+
### Metrics Explanation
|
| 271 |
|
| 272 |
+
- **Token Accuracy (81%)**: Measures how many individual tokens (words/subwords) match the ground truth
|
| 273 |
+
- **Validation Loss (0.651)**: Lower is better; indicates model's prediction confidence
|
| 274 |
+
- **Entropy (0.665)**: Low entropy means the model makes confident predictions rather than being uncertain
|
| 275 |
|
| 276 |
+
### Comparison to Base Model
|
| 277 |
|
| 278 |
+
The fine-tuned adapter shows significant improvements in the legal domain:
|
| 279 |
+
- Better understanding of Korean legal terminology
|
| 280 |
+
- More accurate citations of relevant laws and regulations
|
| 281 |
+
- Reduced hallucination on IP law topics
|
| 282 |
|
| 283 |
+
## Citation
|
| 284 |
|
| 285 |
+
If you use this model in your research, please cite:
|
| 286 |
|
| 287 |
+
```bibtex
|
| 288 |
+
@misc{patent-qa-llama3-qlora,
|
| 289 |
+
author = {tree193nn},
|
| 290 |
+
title = {Korean Patent QA with LLaMA-3 QLoRA},
|
| 291 |
+
year = {2024},
|
| 292 |
+
publisher = {Hugging Face},
|
| 293 |
+
howpublished = {\url{https://huggingface.co/tree193nn/patent-qa-llama3-qlora}},
|
| 294 |
+
note = {QLoRA adapter for Korean patent and trademark law question answering}
|
| 295 |
+
}
|
| 296 |
+
```
|
| 297 |
|
| 298 |
+
## License
|
| 299 |
|
| 300 |
+
- **Base Model**: LLaMA-3 License (Meta)
|
| 301 |
+
- **Adapter**: MIT License
|
| 302 |
+
- **Training Data**: Public Korean Intellectual Property Tribunal documents
|
| 303 |
|
| 304 |
+
## Acknowledgments
|
| 305 |
|
| 306 |
+
- **Base Model**: [MLP-KTLim/llama-3-Korean-Bllossom-8B](https://huggingface.co/MLP-KTLim/llama-3-Korean-Bllossom-8B)
|
| 307 |
+
- **Training Method**: QLoRA by Dettmers et al. ([Paper](https://arxiv.org/abs/2305.14314))
|
| 308 |
+
- **Data Source**: Korean Intellectual Property Tribunal
|
| 309 |
|
| 310 |
+
## Contact
|
| 311 |
|
| 312 |
+
- **GitHub**: [CocoaSoymilk/patent-qa-llama3-qlora](https://github.com/CocoaSoymilk/patent-qa-llama3-qlora)
|
| 313 |
+
- **Hugging Face**: [tree193nn](https://huggingface.co/tree193nn)
|
| 314 |
|
| 315 |
+
## Version History
|
| 316 |
|
| 317 |
+
### v1.0.0 (2024-12-07)
|
| 318 |
|
| 319 |
+
- Initial release
|
| 320 |
+
- Fine-tuned on 8,502 Korean patent decision documents
|
| 321 |
+
- Achieved 81% token accuracy
|
| 322 |
+
- QLoRA adapter with 4-bit quantization
|
| 323 |
|
| 324 |
+
---
|
| 325 |
|
| 326 |
+
<div align="center">
|
| 327 |
|
| 328 |
+
**Built with β€οΈ for the Korean legal AI community**
|
| 329 |
|
| 330 |
+
</div>
|
|
|
|
| 331 |
|
|
|