Lielo valodas modeļu novērtēšana un pielāgošana jautājumu atbildēšanai par Latvijas likumdošanu

Loading...
Thumbnail Image

Date

Journal Title

Journal ISSN

Volume Title

Publisher

Latvijas Universitāte

Language

lav

Abstract

Likumi un normatīvie akti ir neatņemama dzīves sastāvdaļa. Tie var būt attiecināmi gan valsts, gan iestāžu līmenī, un tie var attiekties gan uz fiziskām, gan juridiskām personām. Pastāv vairāki dokumentu veidi, kas apraksta likumus un normatīvos aktus, un tie var būt aprakstīti daudzās daļās un pantos, kurus nespeciālistam pilnībā pārzināt ir sarežģīti gan apjoma, gan savstarpējo nosacījumu, gan regulāru izmaiņu dēļ. Šajā darbā tiek apskatīti atvērtie lielie valodu modeļi un to spēja atbildēt uz jautājumiem, kas saistīti ar Latvijas likumdošanu. Darbā tiek arī eksperimentāli pārbaudīts, vai atvērto modeļu instrukciju pielāgošana un/vai konteksta automātiska izguve spēj uzlabot modeļu spējas atbildēt uz jautājumiem par Latvijas likumdošanu. Darba ietvaros veikta vairāku vadošo atvērto daudzvalodu modeļu (Gemma-3, Llama-3.1, EuroLLM) instrukciju pielāgošana, kā arī izstrādāts eksperimentāls RAG ietvars, lai nodrošinātu modelim likumdošanas kontekstu par doto jautājumu. Oriģinālie un pielāgotie modeļi tiek testēti ar cilvēku sagatavotiem jautājumiem un atbildēm no LVportāls.lv arhīva. Iegūtie rezultāti liecina, ka izstrādātais RAG risinājums un modeļu domēnspecifiska pielāgošana var sniegt uzlabojumus modeļu atbildēs salīdzinājumā ar šo modeļu bāzes versijām, taču uzlabojumi nav garantēti un ir atkarīgi no katra konkrētā bāzes modeļa.
Laws and regulations are an integral part of life. They can be applicable at both the national and institutional levels, and they can apply to both natural and juridical people. There are several types of documents that describe the laws, and they can be described in many parts and articles, which are difficult to fully understand for non-experts, due to law amount, mutual conditions and regular changes. This work examines open-source large language models and their ability to answer questions related to Latvian legislation. The work also experimentally examines whether model instruuction fine-tuning and/or automated context retrieval can improve the ability of models to answer questions regarding Latvian legislation. Within the scope of the work several open-source large language models (Llama-3.1, Gemma-3, EuroLLM) were fine-tuned and an experimental RAG framework was implemented in order to provide context for the model about the question. Baseline and fine-tuned models were tested with human prepared questions and answers from LVportals.lv archive. The results obtained show that the implemented RAG and domain specific fine-tuning can achive improvements in the model responses compared to their baseline versions, but the improvements are not guaranteed and depend on each specific base model.

Citation

Relation

Endorsement

Review

Supplemented By

Referenced By