Czym są Large Language Models (LLMs) i jaki jest ich potencjał?
Duże Modele Językowe (LLM - Large Language Models) mogą odpowiadać na różnorodne zapytania ludzkie. Powstały w wyniku analizy ('szkolenia') ogromnej ilości informacji. Budowa takich modeli obejmuje co najmniej kilka faz takich jak przygotowanie danych, wstępne ich przetworzenie a następnie zastosowanie odpowiednich "tranformatorów" które potrafią obsłużyć różne języki, znaczenie analizowanych materiałów i utworzyć zbiór który jest "modelem językowym". Ten zbiór jest skondensowaną wiedzą i regułami które potrafią obsłużyć zapytania użytkowników. Coś jak encyklopedia Britannica. Co więcej, reguły zawarte w tym modelu mogą być użyte do analizy zewnętrznego źródła danych który nie był obecny podczas "trenowania" modelu - np. wewnętrzna informacja Twojej firmy.
Kiedy mowa o '"sztucznej inteligencji", magicznym terminem który się zawsze pojawia jest "trenowanie". Samo "trenowanie", czyli analiza materiału (źródłowych danych) to tylko jeden z etapów i etap ten nie byłby możliwy bez wcześniejszego zaprojektowania odpowiedniego transformatora (lub kilku). Transformatory mają różne zastosowanie, architekturę i przeznaczenie. Rezultaty ich pracy, np. właśnie "modele językowe" mają różna złożoność i różne przeznaczenie. Kiedy mówimy o "modelach" większość z nas wyobraża sobie natychmiast GPT, Google Gemini czy Ollama. Ale modelami mogą być także np. modele SBERT - są stosowane głównie do rozwiązywania problemów związanych z analizą semantyczną tekstu, w szczególności do zadań, w których istotne jest porównywanie i ocenianie semantycznej podobieństwa między zdaniami lub krótkimi tekstami. Wymieńcie dziesiątki lub nawet setki innych.
Tak więc modele językowe które zostały zbudowane za pomocą transformatorów same zawierają transformatory w celu realizacji zadań jakie postawiono przed tymi modelami. Np. za pomocą modeli SBERT możesz tworzyć osadzenia (embeddings) w wektorowych bazach danych. Przeczytaj więcej na ten temat. Te właśnie "osadzenia" odgrywają kluczową role kiedy wykorzystujesz Duży Model Językowy (LLM w języku angielskim) w koncepcji RAG - Retrieval-Augmented Generation.
Transformatory to rodzaj wielowarstwowej architektury , która przekształca lub zmienia sekwencję wejściową w sekwencję wyjściową. Rozważmy na przykład następującą sekwencję wejściową: „Jaki jest kolor nieba?” Model transformatora wykorzystuje wewnętrzną reprezentację matematyczną, która identyfikuje trafność i związek między słowami kolor, niebo i błękit. Wykorzystuje tę wiedzę, zawartą w modelu, do generowania danych wyjściowych: „Niebo jest niebieskie”. Warstwy transformatorów mogą być można układać jedną na drugiej, tworząc głębsze transformatory i potężne modele językowe. Transformatory biorą udział zarówno w tworzeniu modelu językowego jak i w są zawarte w nich samych by obsługiwać zapytania użytkowników.
Jak powstaje model językowy?
Jak złożone jest to przedsięwzięcie można prześledzić na przykładzie modelu llama firmy Meta (Facebook). W lutym 2023 r wydano Llamę. Już w lipcu 2023 r Llamę2, udostępniając ją bezpłatnie do celów badawczych i komercyjnych, z pewnymi skromnymi ograniczeniami. Prawdopodobnie jeszcze w roku 2024 pojawi się kolejna wersja - Llama3. Obecnie Meta do trenowania tych modeli wykorzystuje infrastrukturę która mniej więcej odpowiada 300 tysiącom wysokiej klasy komputerów osobistych. Ale to mało. Jak powiedział Zuckerberg:
„Budujemy ogromną infrastrukturę obliczeniową, aby wspierać nasz przyszły plan działania… w sumie prawie 600 tys. odpowiedników mocy obliczeniowej H100”
To są ogromne liczby zarówno jeśli chodzi o ilość sprzętu jak i kwoty - ta inwestycja równałaby się 20 miliardom dolarów na chipy. "Trenowanie modelu" to nie jest zadanie dla Twojego biurkowego PC. Jeśli zainteresuje Cię czym jest słynny "H100", przeczytaj więcej o tym układzie na stronie Nvidia.
Rezultat "trenowania modelu" to prawdziwy diament; cała ta wiedza o której mowa powyżej potrafi być zawarta w zbiorze danych który często nie przekracza 4GB.
Product recommendations
The value for business. Shedding the light on recommendation engines details.
Product recommendations in online stores are worth implementing for several reasons, as they can significantly benefit both the consumers and the retailers. Here are some key reasons why product recommendations are valuable:
- Enhanced Customer Experience: Product recommendations provide a personalized shopping experience for customers.
- Increased Sales: Personalized recommendations can lead to higher conversion rates and increased sales.
- Time Savings for Customers: In a vast online marketplace, customers may feel overwhelmed by the sheer number of products available.
- Improved Customer Retention: By offering a personalized and positive shopping experience, online stores can build stronger relationships with their customers.
- Competitive Advantage: In the competitive world of e-commerce, providing a unique and personalized shopping experience can set a store apart from its competitors.
- Data Utilization: Product recommendation algorithms leverage customer data to understand their preferences and behaviors.
- Adaptability and Continuous Improvement: Recommendation systems can adapt and improve over time.
That is what GPT chat said and other sites quote. The fact that personalized recommendations are "worth implementing" seems obvious. It is much more difficult to answer the question "What is the real value of these recommendations - how much profit do they bring?"
What is the real value of product recommendations?
If we take the trouble to check out the results of such a query in Google, we will find out that 35% of Amazon's sales come from recommendations and Netflix achieved 75%. This information originates from some consulting company - published a few years ago is like Garner's "80% of..." or has similar "trust me" certificate. It is undoubtedly impressive, which is why it is often quoted in many materials. Direct revenue increases are more often reported to lie between one and five percent, which can also be substantial in absolute numbers
It is undisputed that recommender systems can have positive business effects in a variety of ways. However, how large these effects actually are - compared to a situation without a recommender system or with a different algorithm - is not always clear.
Unfortunately, while nowadays a number of research datasets are available, they usually do not contain quantitative data from which the business value can be directly inferred. Furthermore, since the choice of a business measures is often specific for a domain, researchers typically abstract from these specific domain what gives simplified results.
The business value of the recommender systems is not adequately defined, measured, or analyzed, potentially leading to wrong conclusions about the true impact of the systems.
Companies usually do not publicly share the exact details about how they profit from the use of recommendation technology and how frequently recommendations are adopted by their customers – main purpose of such information is product or service marketing.
Ticketing tool or BPM platform?
How to organize the environment of custom-built applications and ticket handling tools even more effectively and speed up processes.
Every company has a certain set of applications that are specially developed to support company needs or used in specific way to support some processes running within organization. Custom-built software or application is built specifically for what you need it for - the specific needs of your business.
To avoid communication chaos, we often use tools that are specialized in ticket handling. Ticketing system organizes activities and communication between the customer, the company, and the company teams in charge of meeting demands. In the vast majority of business applications we have some kind of workflow and process organization of work, but ticketing software provides a higher level of work organization, setting priorities, process follow-up and analyzing result.
Our dedicated applications are most often used to work with data and Help Desk/Service Desk systems are used to manage processes.
However, in such an organized architecture, we quickly notice gaps. In every business, a group of people do their job to "deliver value". But we don't do everything together and we break the task into activities because we specialize and carry out tasks according to skills - role. We do our job and pass it on to the next person - like an assembly line. If our production line consists of many unconnected sections, the process is not very effective. These are some of the challenges to deal with.
Information exchange (Interoperability) needed
In order to guarantee a productive, efficient and intelligent work that adds value, reduces costs and is scalable, interoperability is essential. It is impossible to carry out all company operations in one system and companies usually use many dedicated applications to perform various tasks. However, processes often pass through more than one system and therefore data exchange between them is required.
Lack of visibility is killing productivity
Resource shortages, communication frustration, and missed due dates - these can be an outcome of a lack of visibility. It’s pretty common to find teams or employees that are very good at their own tasks, but they have no global view of the company.
If we do not have a clear picture of the entire process, it is difficult to identify potential bottlenecks. Without centralized information about quality, execution time and resources used to perform individual tasks in the process - we are not able to measure or improve the process and therefore we do not manage it.
Applications are expensive
Software is the engine of today’s business - bloodstream of economy. But software cost a fortune. The global software market is predicted to reach a value of 872.72 billion of USD by 2028 [Skyquest Technology Consulting].
The ticketing software we are talking about here, which helps handle corporate processes, is becoming more and more sophisticated and its price is increasing every year - the bigger pool of users, the higher cost it is. Not all users use this class of software in the same intensive way - quite often we have a situation when simply reading information is not enough, but access to full functionality is excessive.
Multiple instance of the same category systems within the company
For various reasons, companies often have multiple instances of software that support processes; ticketing, project tasks and collaboration.
Sometimes it is the legacy of the organizations that have been brought together, sometimes it is conscious choices due to different needs or simply units location but the consequence is always same- these apps remain unconnected.
It can be done in a better way
In fact, most modern ticketing applications offer great freedom in creating configurations tailored to various needs and the ability to connect to various systems. But sooner or later we reach a wall where we have to sacrifice too much to get little, and some of the problems described above remain anyway.
Let's take as an example the onboarding of a new employee in a company. When a new person is hired, a number of activities is performed; employee is created in the systems, equipped with the equipment necessary and properly trained to start work. A sample process diagram might look like below.
Tworzenie osadzeń [embeddings] dla wyszukiwania wektorowego Neo4j
Jeśli temat 'wyszukiwania wektorowego' jest dla Ciebie nowy, przejdź na wcześniejszą stronę tego bloga by zapoznać się z tym przedmiotem. W tym artykule dowiesz się jak tworzyć osadzenia - wektory w wielowymiarowej przestrzeni. Czyli zamiana słów, zdań i zapytań na wektory.
Odczytanie danych z pliku Excela
Tworzymy embeddings dla opisów produktów. Nasza baza produktów znajduje się w pliku Excela. Użyjemy modułu pandas który wykorzystuje openpyxl by odczytać plik Excela. Utworzone wektory zapiszemy w pliku emb_result.csv [kolumny sku;description;embedding]
from sentence_transformers import SentenceTransformer
import numpy as np
import pandas as pd
import re
#Model 50 jezykow w tym Polski
model = SentenceTransformer('paraphrase-multilingual-MiniLM-L12-v2')
#Sprawdzmy ile tokenów słów obsługuje model:
print("Max Sequence Length:", model.max_seq_length)
#Ustawienie maksymalnej długości kodowanych sekwencji
model.max_seq_length = 128
#Otwarcie pliku Excela, skoroszyt 0
file_name = "produkty.xlsx"
sheet = 0
#Otwarcie pliku, kolumny 0 i 19
df = pd.read_excel(io=file_name, sheet_name=sheet, usecols=[0, 19])
#Listuj 5 pierwszych linii pliku
#print(df.head(5))
#Testowy zapis do pliku:
#kolumna_do_zapisu = df[['sku', 'product description']]
#kolumna_do_zapisu.to_csv('test.csv', index=False)
file = open("emb_result.csv", "w", encoding='utf-8')
for index, row in df.iterrows():
emb = model.encode(row['product description'])
emb_str = np.array2string(emb, separator=',')
emb_str = emb_str.replace("\n","")
emb_str =emb_str.replace(" ","")
emb_str = re.sub(r'[\[\]]', '', emb_str)
file.write(str(row['sku']) + ';' + row['product description'] + ';' + emb_str)
file.write("\n")
file.close()