RAG - Llama2-7b
Contexte du projet
Dans le cadre d'une initiative personnelle visant à explorer les frontières de l'intelligence artificielle en traitement du langage naturel, j'ai entrepris de développer une architecture RAG. Ce projet innovant combine les capacités de récupération d'informations (comme celles utilisées dans les moteurs de recherche) avec les processus de génération de texte basés sur des modèles de langage avancés. L'objectif était de créer un système capable de générer des réponses non seulement pertinentes mais également informatives en extrayant des connaissances de vastes corpus de données.
Pourquoi est-ce intéressant ?
L'approche du Retrieval Augmented Generation premet de résoudre un certain nombre de soucis connus liés aux LLMs.
Ces soucis sont principalement:
L'hallucination : Les LLMs ont tendance à créer de fausses informations avec un haut niveau de confiance.
Obsolescence : L'entrainement d'un LLM étant coûteux (en argent ET en temps), ces modèles sont entrainés à des intervalles très espacés ce qui peut les rendres obscolètes au regard des informations non à jour sur lesquelles ils ont été entrainés.
Attribution : Le comportement des LLMs est parfois obscur et ne reflète pas ses données d'entrainement. Dans cette situation, il est presque impossible de comprendre pourquoi cette réaction arrive.
Customisation : Encore une fois à cause de leur difficulté d'entrainement, il est difficile de spécialisé un LLM sur vos données/procédures.
Grâce à une approche RAG, on peut résoudre ces 4 problèmes.
Déroulement du projet
Recherche et Conception
Étude approfondie des modèles de génération de texte
Comparaison des meilleurs façon de créer des "chunks" à partir de documents complexes
Comparaison des meilleurs embedders open-source/light-weight
Comparaison des bases de données vectorielles open-source
Implémentation et Tests
Création d'un dataset d'articles (lien, titre, contenu) sur la situation récente au moyen-orient.
Création des embeddings de ces documents
Création d'un index vectoriel de ces documents
Ecriture de fonctions pour faciliter l'utilisation des différents composants
Implémentation du RAG sur Llama2-7b
Création de questions d'évalution pour le modèle
Evaluation du modèle grâce à BERTScore (+4% par rapport à Llama2-7b sans RAG avec seulement un petit montant de données)
Optimisation et Déploiement
Déploiement sur Google Colab (pour les ressources GPU nécessaire)
Création d'une interface Gradio
Résultats et impact
Ce projet a renforcé ma compréhension des systèmes hybrides en IA et a élargi mes compétences en développement logiciel et analyse de données. Il a aussi souligné l'importance de l'interaction entre les composantes de récupération d'informations et de génération de texte, ouvrant des perspectives pour des applications futures dans des domaines.
Comparaison
gpt3.5
The living situation in Gaza is complex and challenging due to various factors, including political, economic, and social issues. Gaza is a densely populated area with limited resources and infrastructure, exacerbated by ongoing conflicts and blockades.
The economy in Gaza faces significant challenges, with high unemployment rates and widespread poverty. Access to basic necessities such as clean water, electricity, and healthcare can be limited, and the infrastructure has been heavily damaged by conflicts.
The political situation, including the Israeli blockade and restrictions on the movement of goods and people, adds further strain to daily life in Gaza. This blockade has been in place for years and severely restricts the flow of goods and people in and out of Gaza, contributing to economic hardship and humanitarian concerns.
Additionally, the region has experienced periodic escalations of violence, further disrupting daily life and causing widespread suffering among the civilian population. The lack of a long-term resolution to the Israeli-Palestinian conflict contributes to ongoing instability and hardship in Gaza.
Humanitarian organizations work to provide aid and assistance to the people of Gaza, but the situation remains challenging and in need of sustained international attention and support.
RAG | Llama2-7b
The living situation in Gaza is dire and has been deteriorating due to the ongoing conflict between Israel and Hamas. The strip is home to over 2 million people, and the majority of them are refugees or descendants of refugees who fled or were driven from their homes during the 1948 war that accompanied Israel's creation, known to Palestinians as the "Nakba" or catastrophe.
Since the latest conflict began in October, the situation in Gaza has become increasingly dire. The Israeli military has launched a ground offensive in addition to its air and sea assaults, leading to widespread destruction and a large number of civilian casualties. The United Nations has reported that over 30,000 Palestinians have been killed, including thousands of children, women, and other non-combatants.
The displacement of Palestinians in Gaza has been severe, with many families losing their homes and belongings. According to the United Nations, over 90% of Gaza's population has been affected by the conflict, and over 100,000 people have been displaced from their homes. Many of these displaced people are seeking shelter in schools, mosques, and other public buildings, while others have been forced to live in makeshift camps.
The humanitarian situation in Gaza is also dire, with shortages of food, water, and medical supplies. The United Nations has warned of a looming "humanitarian disaster" in Gaza, with over 80% of the population in need of some form of assistance. The conflict has also had a significant impact on Gaza's economy, with many businesses and industries destroyed or damaged, leading to widespread unemployment and poverty.
Overall, the living situation in Gaza is characterized by extreme poverty, displacement, and instability, with many Palestinians facing a dire and uncertain future. The situation has been described as a "catastrophe" by many, and there are concerns about the long-term effects of the conflict on the health, education, and economic well-being of the population.
Sources:
[https://www.reuters.com/world/middle-east/palestinians-gaza-say-israeli-bombardment-feels-like-new-nakba-2023-10-10/]
[https://www.reuters.com/world/middle-east/gazas-main-hospital-becomes-teeming-camp-displaced-people-2023-11-07/]
[https://www.reuters.com/world/middle-east/palestinians-fleeing-fighting-south-find-no-escape-danger-2023-10-15/]
[https://www.reuters.com/world/middle-east/israeli-ground-invasion-looms-gaza-residents-gird-battle-2023-10-27/]
[https://www.reuters.com/world/middle-east/keys-lost-homes-gaza-become-latest-symbols-palestinian-displacement-2024-02-29/]