RayNene commited on
Commit
0d18cc4
·
verified ·
1 Parent(s): 09740de

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +169 -110
README.md CHANGED
@@ -1,202 +1,261 @@
1
  ---
2
- base_model: togethercomputer/Llama-4-Scout-17B-16E-Instruct_bnb_4bit
3
- library_name: peft
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  ---
5
 
6
- # Model Card for Model ID
7
 
8
- <!-- Provide a quick summary of what the model is/does. -->
9
 
 
10
 
 
11
 
12
- ## Model Details
13
-
14
- ### Model Description
15
-
16
- <!-- Provide a longer summary of what this model is. -->
17
-
18
-
19
-
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
-
28
- ### Model Sources [optional]
29
 
30
- <!-- Provide the basic links for the model. -->
31
 
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
 
36
- ## Uses
37
 
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
 
40
- ### Direct Use
41
 
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
 
 
43
 
44
- [More Information Needed]
45
 
46
- ### Downstream Use [optional]
47
 
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
 
50
- [More Information Needed]
51
 
52
- ### Out-of-Scope Use
53
 
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
 
56
- [More Information Needed]
57
 
58
- ## Bias, Risks, and Limitations
59
 
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
 
62
- [More Information Needed]
63
 
64
- ### Recommendations
65
 
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
 
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
 
70
- ## How to Get Started with the Model
71
 
72
- Use the code below to get started with the model.
73
 
74
- [More Information Needed]
 
75
 
76
- ## Training Details
77
 
78
- ### Training Data
 
 
79
 
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
 
82
- [More Information Needed]
83
 
84
- ### Training Procedure
85
 
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
 
 
 
 
 
 
 
 
 
 
87
 
88
- #### Preprocessing [optional]
89
 
90
- [More Information Needed]
91
 
 
92
 
93
- #### Training Hyperparameters
94
 
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
 
 
 
 
 
96
 
97
- #### Speeds, Sizes, Times [optional]
98
 
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
 
101
- [More Information Needed]
102
 
103
- ## Evaluation
104
 
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
 
107
- ### Testing Data, Factors & Metrics
 
 
108
 
109
- #### Testing Data
 
110
 
111
- <!-- This should link to a Dataset Card if possible. -->
112
 
113
- [More Information Needed]
 
 
 
114
 
115
- #### Factors
 
 
 
 
116
 
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
 
119
- [More Information Needed]
120
 
121
- #### Metrics
122
 
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
 
125
- [More Information Needed]
 
 
126
 
127
- ### Results
 
 
128
 
129
- [More Information Needed]
 
 
130
 
131
- #### Summary
 
 
132
 
 
 
 
133
 
 
134
 
135
- ## Model Examination [optional]
136
 
137
- <!-- Relevant interpretability work for the model goes here -->
138
 
139
- [More Information Needed]
 
 
 
 
 
 
140
 
141
- ## Environmental Impact
142
 
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
 
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
 
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
 
153
- ## Technical Specifications [optional]
154
 
155
- ### Model Architecture and Objective
156
 
157
- [More Information Needed]
158
 
159
- ### Compute Infrastructure
160
 
161
- [More Information Needed]
162
 
163
- #### Hardware
164
 
165
- [More Information Needed]
166
 
167
- #### Software
168
 
169
- [More Information Needed]
170
 
171
- ## Citation [optional]
172
 
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
 
175
- **BibTeX:**
176
 
177
- [More Information Needed]
 
178
 
179
- **APA:**
180
 
181
- [More Information Needed]
 
 
 
 
 
 
 
 
 
182
 
183
- ## Glossary [optional]
184
 
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
 
187
- [More Information Needed]
188
 
189
- ## More Information [optional]
190
 
191
- [More Information Needed]
192
 
193
- ## Model Card Authors [optional]
194
 
195
- [More Information Needed]
196
 
197
- ## Model Card Contact
198
 
199
- [More Information Needed]
200
- ### Framework versions
201
 
202
- - PEFT 0.15.1
 
 
1
  ---
2
+ license: llama3.3
3
+ base_model: meta-llama/Llama-3.3-70B-Instruct
4
+ language:
5
+ - en
6
+ - fr
7
+ - et
8
+ library_name: transformers
9
+ pipeline_tag: text-generation
10
+ tags:
11
+ - legal
12
+ - law
13
+ - multilingual
14
+ - english
15
+ - french
16
+ - estonian
17
+ - legal-reasoning
18
+ - lora
19
+ - instruction-tuning
20
+ - llama-3
21
+ - adaption-labs
22
+ datasets:
23
+ - RayNene/Trilex
24
  ---
25
 
26
+ # TriLex
27
 
28
+ > **Understanding law across borders, languages, and legal traditions.**
29
 
30
+ *A multilingual legal reasoning model adapted from Llama 3.3 70B Instruct for English, French, and Estonian legal understanding.*
31
 
32
+ ---
33
 
34
+ # Why TriLex?
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
+ Law has never been more global.
37
 
38
+ A company incorporated in London may negotiate contracts governed by French law. An AI researcher may compare judicial systems across Europe. Citizens increasingly seek legal information online before consulting legal professionals. Governments themselves frequently study how other jurisdictions address similar policy challenges.
 
 
39
 
40
+ Yet most legal language models remain confined to a single legal system or language.
41
 
42
+ TriLex was built to move beyond that limitation.
43
 
44
+ Instead of specializing in only one jurisdiction, TriLex has been adapted to understand three distinct legal traditions:
45
 
46
+ - 🇬🇧 **England** Common Law built through judicial precedent
47
+ - 🇫🇷 **France** — Civil Law founded on comprehensive legal codification
48
+ - 🇪🇪 **Estonia** — A digitally enabled legal system recognized for modern public administration
49
 
50
+ By exposing the model to multiple legal frameworks, TriLex aims to produce responses that recognize not only legal terminology, but also the institutional reasoning and policy objectives behind different legal systems.
51
 
52
+ ---
53
 
54
+ # The Problem
55
 
56
+ Legal information is often difficult to access.
57
 
58
+ For many people, legislation is written in technical language, court structures differ from one country to another, and understanding how laws interact across jurisdictions requires years of formal education.
59
 
60
+ Meanwhile, AI is rapidly becoming one of the first places people turn when trying to understand legal concepts.
61
 
62
+ That creates an important responsibility.
63
 
64
+ Rather than generating generic legal responses, TriLex was adapted to produce explanations that are clearer, more contextual, and more sensitive to differences between legal systems.
65
 
66
+ The goal is **not** to replace lawyers.
67
 
68
+ The goal is to make legal knowledge easier to understand.
69
 
70
+ ---
71
 
72
+ # Model Overview
73
 
74
+ **Base Model**
75
 
76
+ > Meta Llama 3.3 70B Instruct
77
 
78
+ **Adaptation Method**
79
 
80
+ - LoRA fine-tuning
81
+ - Adaptive Data pipeline by **Adaption Labs**
82
 
83
+ **Languages**
84
 
85
+ - English
86
+ - French
87
+ - Estonian
88
 
89
+ ---
90
 
91
+ # Areas of Expertise
92
 
93
+ TriLex has been adapted for legal reasoning tasks including:
94
 
95
+ - Comparative law
96
+ - Constitutional law
97
+ - Administrative law
98
+ - Civil law
99
+ - Public policy
100
+ - Government structures
101
+ - Judicial systems
102
+ - Legal interpretation
103
+ - Legal education
104
+ - Legal question answering
105
+ - Cross-jurisdiction legal comparisons
106
 
107
+ ---
108
 
109
+ # Training Dataset
110
 
111
+ TriLex was adapted using a multilingual legal instruction dataset containing examples across three legal systems.
112
 
113
+ The dataset includes:
114
 
115
+ - English legal reasoning
116
+ - French legal reasoning
117
+ - Estonian legal reasoning
118
+ - Comparative legal analysis
119
+ - Enhanced instruction-response pairs
120
+ - Semantically enriched legal examples
121
 
122
+ By training on multiple jurisdictions simultaneously, the model learns to distinguish differences in legal traditions while preserving legal context.
123
 
124
+ ---
125
 
126
+ # How to Use
127
 
128
+ This repository contains **LoRA adapter weights**.
129
 
130
+ Load the base model first, then apply the adapter.
131
 
132
+ ```python
133
+ from transformers import AutoModelForCausalLM, AutoTokenizer
134
+ from peft import PeftModel
135
 
136
+ BASE_MODEL = "meta-llama/Llama-3.3-70B-Instruct"
137
+ ADAPTER = "RayNene/TriLex"
138
 
139
+ tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
140
 
141
+ base_model = AutoModelForCausalLM.from_pretrained(
142
+ BASE_MODEL,
143
+ device_map="auto"
144
+ )
145
 
146
+ model = PeftModel.from_pretrained(
147
+ base_model,
148
+ ADAPTER
149
+ )
150
+ ```
151
 
152
+ ---
153
 
154
+ # Prompting Tips
155
 
156
+ TriLex performs best when legal questions include jurisdictional context.
157
 
158
+ ### Examples
159
 
160
+ ```
161
+ Explain the differences between English common law and the French civil law system.
162
+ ```
163
 
164
+ ```
165
+ How does Estonia's digital identity framework support its legal and public administration systems?
166
+ ```
167
 
168
+ ```
169
+ Compare how administrative disputes are handled in France and England.
170
+ ```
171
 
172
+ ```
173
+ Why does England rely heavily on judicial precedent while France relies on codified legislation?
174
+ ```
175
 
176
+ ```
177
+ How do tribunal systems improve judicial efficiency in England?
178
+ ```
179
 
180
+ ---
181
 
182
+ # Intended Applications
183
 
184
+ TriLex is designed for:
185
 
186
+ - Legal education
187
+ - Comparative law research
188
+ - Government policy analysis
189
+ - Legal assistants
190
+ - Academic research
191
+ - Multilingual legal retrieval
192
+ - Domain-adapted language model research
193
 
194
+ ---
195
 
196
+ # Limitations
197
 
198
+ TriLex is intended for research and educational purposes.
199
 
200
+ It does **not** provide legal advice and should never replace consultation with qualified legal professionals. Laws change over time, judicial interpretations evolve, and legal outcomes depend heavily on jurisdiction and individual circumstances.
 
 
 
 
201
 
202
+ ---
203
 
204
+ # Built with Adaption Labs
205
 
206
+ TriLex was developed as part of the **Adaption Labs AutoScientist Challenge**.
207
 
208
+ The project leveraged **Adaptive Data** to enhance and refine multilingual legal instruction data before model adaptation. Adaptive Data made it possible to improve instruction quality, enrich legal reasoning examples, and generate a stronger foundation for domain-specific fine-tuning.
209
 
210
+ Special thanks to **Adaption Labs** for making advanced domain adaptation workflows more accessible to the open-source AI community.
211
 
212
+ ---
213
 
214
+ # Vision
215
 
216
+ The future of legal AI should not stop at answering questions—it should help people understand *why* legal systems differ.
217
 
218
+ Every legal system reflects the history, institutions, and values of the society it serves. By bringing together English common law, French civil law, and Estonia's digital-first governance model, TriLex aims to encourage more transparent, multilingual, and internationally aware legal AI.
219
 
220
+ By releasing both the dataset and model openly, this project hopes to contribute to research, education, and the broader effort to make legal knowledge more accessible worldwide.
221
 
222
+ ---
223
 
224
+ ## Citation
225
 
226
+ If you use TriLex in research or downstream applications, please cite this repository and the accompanying dataset.
227
+ If you use **TriLex** in your research, applications, or derivative work, please cite this repository.
228
 
229
+ ### BibTeX
230
 
231
+ ```bibtex
232
+ @misc{Ray Munene,
233
+ title = {TriLex: A Multilingual Legal Reasoning Model for English, French, and Estonian Law},
234
+ author = {Munene, Ray},
235
+ year = {2026},
236
+ publisher = {Hugging Face},
237
+ howpublished = {\url{https://huggingface.co/RayNene/TriLex}},
238
+ note = {LoRA adaptation of Meta Llama 3.3 70B Instruct developed as part of the Adaption Labs AutoScientist Challenge}
239
+ }
240
+ ```
241
 
242
+ ### APA
243
 
244
+ Munene, R. (2026). *TriLex: A Multilingual Legal Reasoning Model for English, French, and Estonian Law* [Computer software]. Hugging Face. https://huggingface.co/RayNene/TriLex
245
 
246
+ ### Dataset
247
 
248
+ The accompanying multilingual legal dataset is available at:
249
 
250
+ https://huggingface.co/datasets/RayNene/TriLex
251
 
252
+ If you use the training data, please cite both the dataset and the model.
253
 
254
+ ---
255
 
256
+ ## Contact
257
 
258
+ Questions, suggestions, or contributions are welcome.
 
259
 
260
+ - 🤗 Hugging Face: https://huggingface.co/RayNene
261
+ - GitHub: https://github.com/RayMune