Roman Kyslyi: Методи уникнення галюцинацій у великих мовних моделях (UA)

Lviv Startup Club
Lviv Startup ClubLviv Startup Club
Методи уникнення
галюцинацій в великих мовних
моделях
LLM (Large Language Models)
LLM is a language model for next token prediction
Sequence (input +
output embeddings)
Transformer
Softmax
Predicted tokens
Hallucination
- Sentence contradiction:
- Prompt: What is the color of the sky?
Answer: The sky is green
- Prompt contradiction:
- Prompt: Write a positive review about the restaurant.
Answer: The food was terrible and
- Fact contradiction
- Prompt: Who is Joe Biden?
Answer: Joe Biden was first US president
- Contextual:
- Prompt: Tell me about the Paris
Answer: Paris is a capital of France and a name of a singer
Why?
- Data quality
- Scraping a lot of data, wrong facts, imbalance of the classes
- Generalization wrong
- Generation method
- High probability of generic words vs low probability of specific words
- Insufficient context (“Can cats speak eng?”)
- Not accurate parameters
- length of the generation
- Temperature
- etc.
Source: https://arxiv.org/pdf/2212.10511.pdf
Source: https://betterprogramming.pub/unifying-llm-powered-qa-techniques-with-routing-abstractions-438e2499a0d0
Two model paradigm
- Completion model (generates response)
- Probability model (response tokens with probability)
Ideally this should be the same models
Metrics
Dataset for evaluation: WikiBio, OpenAssistant Conversations Dataset
Probability metrics:
- LogProbs
- PPL-5 (approximate top 5 LogProbs)
Aggregation metrics:
- Min (LogProbs and PPL-5) over the text
- Average (LogProbs and PPL-5) over the text
How to reduce (simple)
- Precice prompt
- Instead “What happened in 1964?” use “Tell date of the Beatles albums releases”
- Temperature
- Higher values make outputs more random, while lower values make the outputs more deterministic
- Multi shot prompting
- Use several prompts to to give more context
- Ask the model to verify itself
How to reduce (more complex)
Compute BLEU between all pairs:
- Measures quality of machine-generated translations.
- Compares machine translation to human reference translations.
- Calculates precision of n-grams (e.g., 1-4 word sequences).
- Higher BLEU score (0-100) = closer to human translation.
Several requests with slightly different question (NER + distances)
(https://crfm.stanford.edu/2023/03/13/alpaca.html)
How to reduce (more complex)
Check on Knowledge Graph
(with additional data)
https://github.com/neo4j/NaLLM
How to reduce (more complex)
Reference: https://towardsdatascience.com/from-text-to-knowledge-the-information-extraction-pipeline-b65e7e30273e
Thank you!
Q&A
Subscribe:
https:/
/www.youtube.com/@aihouse_ukraine
1 von 12

Recomendados

NLP_guest_lecture.pdf von
NLP_guest_lecture.pdfNLP_guest_lecture.pdf
NLP_guest_lecture.pdfSoha82
8 views38 Folien
Introduction to Natural Language Processing von
Introduction to Natural Language ProcessingIntroduction to Natural Language Processing
Introduction to Natural Language ProcessingPranav Gupta
31.9K views34 Folien
Querying data on the Web – client or server? von
Querying data on the Web – client or server?Querying data on the Web – client or server?
Querying data on the Web – client or server?Ruben Verborgh
1.8K views66 Folien
Google's Pathways Language Model and Chain-of-Thought von
Google's Pathways Language Model and Chain-of-ThoughtGoogle's Pathways Language Model and Chain-of-Thought
Google's Pathways Language Model and Chain-of-ThoughtVaclav1
201 views46 Folien
Word embeddings von
Word embeddingsWord embeddings
Word embeddingsShruti kar
158 views15 Folien
Svetlin Nakov - Improved Word Alignments Using the Web as a Corpus von
Svetlin Nakov - Improved Word Alignments Using the Web as a CorpusSvetlin Nakov - Improved Word Alignments Using the Web as a Corpus
Svetlin Nakov - Improved Word Alignments Using the Web as a CorpusSvetlin Nakov
394 views32 Folien

Más contenido relacionado

Similar a Roman Kyslyi: Методи уникнення галюцинацій у великих мовних моделях (UA)

CMSC 723: Computational Linguistics I von
CMSC 723: Computational Linguistics ICMSC 723: Computational Linguistics I
CMSC 723: Computational Linguistics Ibutest
1K views54 Folien
"Machine Translation 101" and the Challenge of Patents von
"Machine Translation 101" and the Challenge of Patents"Machine Translation 101" and the Challenge of Patents
"Machine Translation 101" and the Challenge of PatentsIconic Translation Machines
334 views30 Folien
Webinar: Simpler Semantic Search with Solr von
Webinar: Simpler Semantic Search with SolrWebinar: Simpler Semantic Search with Solr
Webinar: Simpler Semantic Search with SolrLucidworks
2.6K views34 Folien
2017 biological databases_part1_vupload von
2017 biological databases_part1_vupload2017 biological databases_part1_vupload
2017 biological databases_part1_vuploadProf. Wim Van Criekinge
1.8K views84 Folien
Practical NLP with Lisp von
Practical NLP with LispPractical NLP with Lisp
Practical NLP with LispVsevolod Dyomkin
4.5K views45 Folien
BigData and Algorithms - LA Algorithmic Trading von
BigData and Algorithms - LA Algorithmic TradingBigData and Algorithms - LA Algorithmic Trading
BigData and Algorithms - LA Algorithmic TradingTim Shea
2K views52 Folien

Similar a Roman Kyslyi: Методи уникнення галюцинацій у великих мовних моделях (UA)(20)

CMSC 723: Computational Linguistics I von butest
CMSC 723: Computational Linguistics ICMSC 723: Computational Linguistics I
CMSC 723: Computational Linguistics I
butest1K views
Webinar: Simpler Semantic Search with Solr von Lucidworks
Webinar: Simpler Semantic Search with SolrWebinar: Simpler Semantic Search with Solr
Webinar: Simpler Semantic Search with Solr
Lucidworks2.6K views
BigData and Algorithms - LA Algorithmic Trading von Tim Shea
BigData and Algorithms - LA Algorithmic TradingBigData and Algorithms - LA Algorithmic Trading
BigData and Algorithms - LA Algorithmic Trading
Tim Shea2K views
RNA-seq differential expression analysis von mikaelhuss
RNA-seq differential expression analysisRNA-seq differential expression analysis
RNA-seq differential expression analysis
mikaelhuss19.4K views
lec21.ppt von butest
lec21.pptlec21.ppt
lec21.ppt
butest72 views
lec21.ppt von butest
lec21.pptlec21.ppt
lec21.ppt
butest80 views
lec21.ppt von butest
lec21.pptlec21.ppt
lec21.ppt
butest67 views
lec21.ppt von butest
lec21.pptlec21.ppt
lec21.ppt
butest84 views
lec21.ppt von butest
lec21.pptlec21.ppt
lec21.ppt
butest209 views
lec21.ppt von butest
lec21.pptlec21.ppt
lec21.ppt
butest190 views
lec21.ppt von butest
lec21.pptlec21.ppt
lec21.ppt
butest124 views
lec21.ppt von butest
lec21.pptlec21.ppt
lec21.ppt
butest111 views
Lecture 7- Text Statistics and Document Parsing von Sean Golliher
Lecture 7- Text Statistics and Document ParsingLecture 7- Text Statistics and Document Parsing
Lecture 7- Text Statistics and Document Parsing
Sean Golliher973 views
A look inside Babelfy: Examining the bubble von Filip Ilievski
A look inside Babelfy: Examining the bubbleA look inside Babelfy: Examining the bubble
A look inside Babelfy: Examining the bubble
Filip Ilievski69 views
Using topic modelling frameworks for NLP and semantic search von Dawn Anderson MSc DigM
Using topic modelling frameworks for NLP and semantic searchUsing topic modelling frameworks for NLP and semantic search
Using topic modelling frameworks for NLP and semantic search

Más de Lviv Startup Club

Sergiy Kharytonov: Keep Your Business Going via Growth During A Recession (UA) von
Sergiy Kharytonov: Keep Your Business Going via Growth During A Recession (UA)Sergiy Kharytonov: Keep Your Business Going via Growth During A Recession (UA)
Sergiy Kharytonov: Keep Your Business Going via Growth During A Recession (UA)Lviv Startup Club
4 views13 Folien
Andrii Burlutskyi: Account-based marketing в світі AI: що і як робити у 2024 ... von
Andrii Burlutskyi: Account-based marketing в світі AI: що і як робити у 2024 ...Andrii Burlutskyi: Account-based marketing в світі AI: що і як робити у 2024 ...
Andrii Burlutskyi: Account-based marketing в світі AI: що і як робити у 2024 ...Lviv Startup Club
2 views29 Folien
Max Sidorenko: LinkedIn 2024: які стратегії працюватимуть в новому році? (UA) von
Max Sidorenko: LinkedIn 2024: які стратегії працюватимуть в новому році? (UA)Max Sidorenko: LinkedIn 2024: які стратегії працюватимуть в новому році? (UA)
Max Sidorenko: LinkedIn 2024: які стратегії працюватимуть в новому році? (UA)Lviv Startup Club
26 views21 Folien
Pavel Obod: Трансформація мислення CEO: чому зростати в 10 разів швидше і лег... von
Pavel Obod: Трансформація мислення CEO: чому зростати в 10 разів швидше і лег...Pavel Obod: Трансформація мислення CEO: чому зростати в 10 разів швидше і лег...
Pavel Obod: Трансформація мислення CEO: чому зростати в 10 разів швидше і лег...Lviv Startup Club
15 views33 Folien
Valeriy Kozlov: Transition to Fact-Based, Data-Driven Decision Making in B2B ... von
Valeriy Kozlov: Transition to Fact-Based, Data-Driven Decision Making in B2B ...Valeriy Kozlov: Transition to Fact-Based, Data-Driven Decision Making in B2B ...
Valeriy Kozlov: Transition to Fact-Based, Data-Driven Decision Making in B2B ...Lviv Startup Club
7 views20 Folien
Maryna Ruban: Рецесія? Чи є світло в кінці тунелю та коли будуть ліди з SEO? ... von
Maryna Ruban: Рецесія? Чи є світло в кінці тунелю та коли будуть ліди з SEO? ...Maryna Ruban: Рецесія? Чи є світло в кінці тунелю та коли будуть ліди з SEO? ...
Maryna Ruban: Рецесія? Чи є світло в кінці тунелю та коли будуть ліди з SEO? ...Lviv Startup Club
21 views25 Folien

Más de Lviv Startup Club(20)

Sergiy Kharytonov: Keep Your Business Going via Growth During A Recession (UA) von Lviv Startup Club
Sergiy Kharytonov: Keep Your Business Going via Growth During A Recession (UA)Sergiy Kharytonov: Keep Your Business Going via Growth During A Recession (UA)
Sergiy Kharytonov: Keep Your Business Going via Growth During A Recession (UA)
Andrii Burlutskyi: Account-based marketing в світі AI: що і як робити у 2024 ... von Lviv Startup Club
Andrii Burlutskyi: Account-based marketing в світі AI: що і як робити у 2024 ...Andrii Burlutskyi: Account-based marketing в світі AI: що і як робити у 2024 ...
Andrii Burlutskyi: Account-based marketing в світі AI: що і як робити у 2024 ...
Max Sidorenko: LinkedIn 2024: які стратегії працюватимуть в новому році? (UA) von Lviv Startup Club
Max Sidorenko: LinkedIn 2024: які стратегії працюватимуть в новому році? (UA)Max Sidorenko: LinkedIn 2024: які стратегії працюватимуть в новому році? (UA)
Max Sidorenko: LinkedIn 2024: які стратегії працюватимуть в новому році? (UA)
Pavel Obod: Трансформація мислення CEO: чому зростати в 10 разів швидше і лег... von Lviv Startup Club
Pavel Obod: Трансформація мислення CEO: чому зростати в 10 разів швидше і лег...Pavel Obod: Трансформація мислення CEO: чому зростати в 10 разів швидше і лег...
Pavel Obod: Трансформація мислення CEO: чому зростати в 10 разів швидше і лег...
Valeriy Kozlov: Transition to Fact-Based, Data-Driven Decision Making in B2B ... von Lviv Startup Club
Valeriy Kozlov: Transition to Fact-Based, Data-Driven Decision Making in B2B ...Valeriy Kozlov: Transition to Fact-Based, Data-Driven Decision Making in B2B ...
Valeriy Kozlov: Transition to Fact-Based, Data-Driven Decision Making in B2B ...
Maryna Ruban: Рецесія? Чи є світло в кінці тунелю та коли будуть ліди з SEO? ... von Lviv Startup Club
Maryna Ruban: Рецесія? Чи є світло в кінці тунелю та коли будуть ліди з SEO? ...Maryna Ruban: Рецесія? Чи є світло в кінці тунелю та коли будуть ліди з SEO? ...
Maryna Ruban: Рецесія? Чи є світло в кінці тунелю та коли будуть ліди з SEO? ...
Danylo Fedirko: Marketing as an ecosystem: how to be in front of your TA ever... von Lviv Startup Club
Danylo Fedirko: Marketing as an ecosystem: how to be in front of your TA ever...Danylo Fedirko: Marketing as an ecosystem: how to be in front of your TA ever...
Danylo Fedirko: Marketing as an ecosystem: how to be in front of your TA ever...
Taras Bachynskyy: M&A, як спосіб масштабування бізнесу. Що було, є і чого вар... von Lviv Startup Club
Taras Bachynskyy: M&A, як спосіб масштабування бізнесу. Що було, є і чого вар...Taras Bachynskyy: M&A, як спосіб масштабування бізнесу. Що було, є і чого вар...
Taras Bachynskyy: M&A, як спосіб масштабування бізнесу. Що було, є і чого вар...
Igor Dumbur: Кейс: встановлення базових планів в Enterprise Level проекті (UA) von Lviv Startup Club
Igor Dumbur: Кейс: встановлення базових планів в Enterprise Level проекті (UA)Igor Dumbur: Кейс: встановлення базових планів в Enterprise Level проекті (UA)
Igor Dumbur: Кейс: встановлення базових планів в Enterprise Level проекті (UA)
Anna Kompanets: Інтеграція проєктного менеджменту та управління змінами. Якос... von Lviv Startup Club
Anna Kompanets: Інтеграція проєктного менеджменту та управління змінами. Якос...Anna Kompanets: Інтеграція проєктного менеджменту та управління змінами. Якос...
Anna Kompanets: Інтеграція проєктного менеджменту та управління змінами. Якос...
Constantine Om: Використання принципів управління проєктами в повсякденному ж... von Lviv Startup Club
Constantine Om: Використання принципів управління проєктами в повсякденному ж...Constantine Om: Використання принципів управління проєктами в повсякденному ж...
Constantine Om: Використання принципів управління проєктами в повсякденному ж...
Anastasiia Terletska: How to manage endangered RnD species (UA) von Lviv Startup Club
Anastasiia Terletska: How to manage endangered RnD species (UA)Anastasiia Terletska: How to manage endangered RnD species (UA)
Anastasiia Terletska: How to manage endangered RnD species (UA)
Viktoriia Honcharova: Вища освіта в управлінні проєктами: пацієнт скоріше жив... von Lviv Startup Club
Viktoriia Honcharova: Вища освіта в управлінні проєктами: пацієнт скоріше жив...Viktoriia Honcharova: Вища освіта в управлінні проєктами: пацієнт скоріше жив...
Viktoriia Honcharova: Вища освіта в управлінні проєктами: пацієнт скоріше жив...
Oleh Oleksiuk: Гордість та упередження в SMM. Чи потрібні соцмережі продукту?... von Lviv Startup Club
Oleh Oleksiuk: Гордість та упередження в SMM. Чи потрібні соцмережі продукту?...Oleh Oleksiuk: Гордість та упередження в SMM. Чи потрібні соцмережі продукту?...
Oleh Oleksiuk: Гордість та упередження в SMM. Чи потрібні соцмережі продукту?...
Chyngys Barynov: Історія Worksection. Розвиток продукту: з нуля, без досвіду ... von Lviv Startup Club
Chyngys Barynov: Історія Worksection. Розвиток продукту: з нуля, без досвіду ...Chyngys Barynov: Історія Worksection. Розвиток продукту: з нуля, без досвіду ...
Chyngys Barynov: Історія Worksection. Розвиток продукту: з нуля, без досвіду ...
Diana Natkhir: Управління змінами та втрата управлінського контролю (UA) von Lviv Startup Club
Diana Natkhir: Управління змінами та втрата управлінського контролю (UA)Diana Natkhir: Управління змінами та втрата управлінського контролю (UA)
Diana Natkhir: Управління змінами та втрата управлінського контролю (UA)
Dmytro Velykoivanenko: What dreams may come or how to practically use vision ... von Lviv Startup Club
Dmytro Velykoivanenko: What dreams may come or how to practically use vision ...Dmytro Velykoivanenko: What dreams may come or how to practically use vision ...
Dmytro Velykoivanenko: What dreams may come or how to practically use vision ...
Anton Hlazkov: Роздутий хайп Agile трансформацій, або хто такий справжній Agi... von Lviv Startup Club
Anton Hlazkov: Роздутий хайп Agile трансформацій, або хто такий справжній Agi...Anton Hlazkov: Роздутий хайп Agile трансформацій, або хто такий справжній Agi...
Anton Hlazkov: Роздутий хайп Agile трансформацій, або хто такий справжній Agi...
Dmytro Lukianov: Agile System Engineering (UA) von Lviv Startup Club
Dmytro Lukianov: Agile System Engineering (UA)Dmytro Lukianov: Agile System Engineering (UA)
Dmytro Lukianov: Agile System Engineering (UA)

Último

See the new MTN tariffs effected November 28, 2023 von
See the new MTN tariffs effected November 28, 2023See the new MTN tariffs effected November 28, 2023
See the new MTN tariffs effected November 28, 2023Kweku Zurek
29.5K views2 Folien
Learning from Failure_ Lessons from Failed Startups.pptx von
Learning from Failure_ Lessons from Failed Startups.pptxLearning from Failure_ Lessons from Failed Startups.pptx
Learning from Failure_ Lessons from Failed Startups.pptxCodeventures
11 views7 Folien
The Truth About Customer Journey Mapping von
The Truth About Customer Journey MappingThe Truth About Customer Journey Mapping
The Truth About Customer Journey MappingAggregage
105 views39 Folien
On the Concept of Discovery Power of Enterprise Modeling Languages and its Re... von
On the Concept of Discovery Power of Enterprise Modeling Languages and its Re...On the Concept of Discovery Power of Enterprise Modeling Languages and its Re...
On the Concept of Discovery Power of Enterprise Modeling Languages and its Re...Ilia Bider
15 views17 Folien
The Talent Management Navigator Performance Management von
The Talent Management Navigator Performance ManagementThe Talent Management Navigator Performance Management
The Talent Management Navigator Performance ManagementSeta Wicaksana
29 views36 Folien
sample.potx von
sample.potxsample.potx
sample.potxMaryna Yurchenko
18 views3 Folien

Último(20)

See the new MTN tariffs effected November 28, 2023 von Kweku Zurek
See the new MTN tariffs effected November 28, 2023See the new MTN tariffs effected November 28, 2023
See the new MTN tariffs effected November 28, 2023
Kweku Zurek29.5K views
Learning from Failure_ Lessons from Failed Startups.pptx von Codeventures
Learning from Failure_ Lessons from Failed Startups.pptxLearning from Failure_ Lessons from Failed Startups.pptx
Learning from Failure_ Lessons from Failed Startups.pptx
Codeventures11 views
The Truth About Customer Journey Mapping von Aggregage
The Truth About Customer Journey MappingThe Truth About Customer Journey Mapping
The Truth About Customer Journey Mapping
Aggregage105 views
On the Concept of Discovery Power of Enterprise Modeling Languages and its Re... von Ilia Bider
On the Concept of Discovery Power of Enterprise Modeling Languages and its Re...On the Concept of Discovery Power of Enterprise Modeling Languages and its Re...
On the Concept of Discovery Power of Enterprise Modeling Languages and its Re...
Ilia Bider15 views
The Talent Management Navigator Performance Management von Seta Wicaksana
The Talent Management Navigator Performance ManagementThe Talent Management Navigator Performance Management
The Talent Management Navigator Performance Management
Seta Wicaksana29 views
Super Solar Mounting Solutions 20230509(1).pdf von carrie55bradshaw
Super Solar Mounting Solutions 20230509(1).pdfSuper Solar Mounting Solutions 20230509(1).pdf
Super Solar Mounting Solutions 20230509(1).pdf
carrie55bradshaw11 views
How UiPath’s European Founder Kept Control and Built an Expert Board of Direc... von Christian Dahlen
How UiPath’s European Founder Kept Control and Built an Expert Board of Direc...How UiPath’s European Founder Kept Control and Built an Expert Board of Direc...
How UiPath’s European Founder Kept Control and Built an Expert Board of Direc...
Christian Dahlen51 views
Why are KPIs(key performance indicators) important? von Epixel MLM Software
Why are KPIs(key performance indicators) important? Why are KPIs(key performance indicators) important?
Why are KPIs(key performance indicators) important?
voice logger software aegis.pdf von Nirmal Sharma
voice logger software aegis.pdfvoice logger software aegis.pdf
voice logger software aegis.pdf
Nirmal Sharma44 views
PMU Launch - Guaranteed Slides von pmulaunch
PMU Launch - Guaranteed SlidesPMU Launch - Guaranteed Slides
PMU Launch - Guaranteed Slides
pmulaunch16 views
Nevigating Sucess.pdf von TEWMAGAZINE
Nevigating Sucess.pdfNevigating Sucess.pdf
Nevigating Sucess.pdf
TEWMAGAZINE24 views
Navigating the Complexity of Derivatives Valuation 📈 von ValAdvisor
Navigating the Complexity of Derivatives Valuation 📈Navigating the Complexity of Derivatives Valuation 📈
Navigating the Complexity of Derivatives Valuation 📈
ValAdvisor14 views
Integrating Talent Management Practices von Seta Wicaksana
Integrating Talent Management PracticesIntegrating Talent Management Practices
Integrating Talent Management Practices
Seta Wicaksana134 views

Roman Kyslyi: Методи уникнення галюцинацій у великих мовних моделях (UA)

  • 1. Методи уникнення галюцинацій в великих мовних моделях
  • 2. LLM (Large Language Models) LLM is a language model for next token prediction Sequence (input + output embeddings) Transformer Softmax Predicted tokens
  • 3. Hallucination - Sentence contradiction: - Prompt: What is the color of the sky? Answer: The sky is green - Prompt contradiction: - Prompt: Write a positive review about the restaurant. Answer: The food was terrible and - Fact contradiction - Prompt: Who is Joe Biden? Answer: Joe Biden was first US president - Contextual: - Prompt: Tell me about the Paris Answer: Paris is a capital of France and a name of a singer
  • 4. Why? - Data quality - Scraping a lot of data, wrong facts, imbalance of the classes - Generalization wrong - Generation method - High probability of generic words vs low probability of specific words - Insufficient context (“Can cats speak eng?”) - Not accurate parameters - length of the generation - Temperature - etc. Source: https://arxiv.org/pdf/2212.10511.pdf
  • 6. Two model paradigm - Completion model (generates response) - Probability model (response tokens with probability) Ideally this should be the same models
  • 7. Metrics Dataset for evaluation: WikiBio, OpenAssistant Conversations Dataset Probability metrics: - LogProbs - PPL-5 (approximate top 5 LogProbs) Aggregation metrics: - Min (LogProbs and PPL-5) over the text - Average (LogProbs and PPL-5) over the text
  • 8. How to reduce (simple) - Precice prompt - Instead “What happened in 1964?” use “Tell date of the Beatles albums releases” - Temperature - Higher values make outputs more random, while lower values make the outputs more deterministic - Multi shot prompting - Use several prompts to to give more context - Ask the model to verify itself
  • 9. How to reduce (more complex) Compute BLEU between all pairs: - Measures quality of machine-generated translations. - Compares machine translation to human reference translations. - Calculates precision of n-grams (e.g., 1-4 word sequences). - Higher BLEU score (0-100) = closer to human translation.
  • 10. Several requests with slightly different question (NER + distances) (https://crfm.stanford.edu/2023/03/13/alpaca.html) How to reduce (more complex)
  • 11. Check on Knowledge Graph (with additional data) https://github.com/neo4j/NaLLM How to reduce (more complex) Reference: https://towardsdatascience.com/from-text-to-knowledge-the-information-extraction-pipeline-b65e7e30273e