We'll show you how to efficiently run Language Models (LLMs) on a standard 16GB RAM machine. During the workshop you will gain hands-on experience with the LangChain framework and have the opportunity to create an application that allows you to interact with your data through natural language.
LangChain enables building applications that connect external sources of data and computation to LLMs.Concerning LangChain and SQL:
One of the most common types of databases that we can build Q&A systems for are SQL databases.Here we used Langchain to access a SQL database (with data about music and musicians) in natural language:
LangChain comes with a number of built-in chains and agents that are compatible with any SQL dialect supported by SQLAlchemy.
They enable use cases such as:and much more (See: LangChain).
- Generating queries that will be run based on natural language questions.
- Creating chatbots that can answer questions based on database data.
- Building custom dashboards based on insights a user wants to analyze.
Active Learning focuses on enabling machines to learn more efficiently from limited labeled data by actively selecting the most informative examples for annotation.Elsewhere, sometimes, described like this:
Active learning machine learning is all about labeling data dynamically and incrementally during the training phase so that the algorithm can identify what label would be the most beneficial for it to learn from [1].I.e.
Active learning is a type of semi-supervised learning, meaning models are trained using both labeled and unlabeled data.Why not label everything from the start?
The active learner algorithm is initially trained on a fully labeled part of the data.
Next, choose the cases from the unlabeled pool where the model is unsure or has low confidence. Ask an oracle -a human annotator or another source of ground truth labels — for labels for the chosen instances [2].
Well: Annotation of the unlabeled dataset costs human effort, time, and money.All very useful, indeed.
Here we will get into what LLMs can and cannot be expected to do. Trying to characterize some of the reasoning limitations of LLMs, and discuss approaches to move toward AI systems that can reason more effectively.
- Drawing conclusions that inform decision making.
The Nature of Reasoning. J.P. Leighton, 2004.
- The drawing of inferences or conclusions from known or assumed facts.
According to Collins dictionary.
Deductive reasoning: Conclusion guaranteed.Where reasoning will help systems to search for solutions to problems, make explainable decisions, verify decisions etc.
Starts with the assertion of a general rule,
and proceeds from there to a guaranteed specific conclusion.
if x = 4
And if y = 1
Then 2x + y = 9
Inductive reasoning: Likely conclusion.
Inductive reasoning begins with observations that are specific and limited in scope, and proceeds to a generalized conclusion that is likely, but not certain, in light of accumulated evidence.
- I have only seen white swans.
- Likely: All swans are white.
Abductive reasoning: Taking your best shot.
Abductive reasoning typically begins with an incomplete set of observations and proceeds to the likeliest possible explanation for the set [4].
Perhaps they can't do planning autonomously straight out of the box,
but can they do it with a little nudge?
...
The first, called ''fine tuning'', is rather straightforward: Take a general LLM and fine tune it on planning problems (i.e., instances and their solutions), with the hope that they will subsequently make better guesses...?
While our own limited experiments didn't show any significant improvement through fine tuning, it is possible that with even more fine tuning data and effort, the quality of LLM guesses may well improve. But all that such fine tuning is doing is converting the planning task into a memory-based approximate retrieval (akin to the memorization/compilation from System 2 to System 1).
It doesn't prove that LLMs are able to plan...
Many of the papers claiming planning abilities of LLMs, on closer examination, wind up confusing general planning knowledge extracted from the LLMs for executable plans. When all we are looking for are abstract plans, such as ''wedding plans'' with no intention of actually executing said plans directly, it is easy to confuse them for complete executable plans.
To summarize, nothing that I have read, verified, or done gives me any compelling reason to believe that LLMs do reasoning/planning, as normally understood [6].
Experiments on three large language models show that chain of thought prompting improves performance on a range of arithmetic, commonsense, and symbolic reasoning tasks [7].And in ''Sparks of Artificial General Intelligence: Early experiments with GPT-4'' is says:
We demonstrate that, beyond its mastery of language, GPT-4 can solve novel and difficult tasks that span mathematics, coding, vision, medicine, law, psychology and more, without needing any special prompting [8].Murray Campbells take here is, that LLMs can behave as though they are reasoning.
Our empirical findings suggest that transformer LLMs solve compositional tasks by reducing multi-step compositional reasoning into linearized subgraph matching, without necessarily developing systematic problem-solving skills [9].In ''Premise Order Matters in Reasoning with Large Language Models'' Xinyun Chen et al. writes:
LLMs are surprisingly brittle to the ordering of the premises, despite the fact that such ordering does not alter the underlying task. In particular, we observe that LLMs achieve the best performance when the premise order aligns with the context required in intermediate reasoning steps [10].In ''Reasoning or Reciting? Exploring the Capabilities and Limitations of Language Models Through Counterfactual Tasks'' Zhaofeng Wu et al. writes:
We observe nontrivial performance on the counterfactual variants, but nevertheless find that performance substantially and consistently degrades compared to the default conditions. This suggests that while current LLMs may possess abstract task-solving skills to an extent, they often also rely on narrow, non-transferable procedures for task-solving [11].And in ''What Algorithms can Transformers Learn? A Study in Length Generalization'' Hattie Zhou, et al. writes:
Large language models exhibit surprising emergent generalization properties, yet also struggle on many simple reasoning tasks such as arithmetic and parity. This raises the question of if and when Transformer models can learn the true algorithm for solving a task.So, LLMs aren't that great at compositionality, putting things together in a new way, and they don't do all that well on more complex examples of simpler tasks they have already learned.
...
Where:
We study the scope of Transformers' abilities in the specific setting of length generalization on algorithmic tasks.
Moreover, we leverage our insights to drastically improve generalization performance on traditionally hard tasks (such as parity and addition) [12].
We propose a framework for robust evaluation of reasoning capabilities of language models, using functional variants of benchmarks [14].Murray Campbell emphasized, that many reasoning benchmarks are just ''ad hoc'' collections of task that researchers have put together. But it is important (obviously) that the reasoning task is not already a part of the training data (for the LLM).
The idea behind contrastive learning is that we have a reference, or ''anchor'' sample, a similar or ''positive'' sample, and a different or ''negative'' sample. We try to bring positive samples close to the anchor sample in an embedding space while pushing negative samples far apart.In order to train this we need some some sort of a ''constrastive loss function''.
...
E.g. embeddings from similar dog images should be closer together, and embeddings from cat images should be further away [15].
It turns out that it is easier for someone with no prior knowledge, like a kid, to learn new things by contrasting between similar and dissimilar things, instead of learning to recognize them one by one. At first, the kid may not be able to identify the dog. But after some time, the kid learns to distinguish the common characteristics among dogs, like the shape of their nose and their body posture [16].How the loss function works:
''Contrastive loss'' is one of the first training objectives that was used for contrastive learning. It takes as input a pair of samples that are either similar or dissimilar, and it brings similar samples closer, and dissimilar samples far apart.
...
- If the samples are similar, then we try to minimize the (embedding) distance between them.
- If the samples are dissimilar, then we try to maximize their (embedding) distance [16].
Traditional recommendation systems often struggle with the complexities of comprehensively understanding user interests.The LLMs can be directly used, as the recommender system, but some sort of integration with a existing recommender system is, of course, also possible.
Enter Large Language Models (LLMs), renowned for their unparalleled strength in language comprehension, generation, generalization and reasoning. In this talk, I'll provide a comprehensive overview of the strategies for seamlessly integrating LLMs into recommendation pipelines.
Triangular AI (AI3) – a new and high-performance generation of Artificial Intelligence that is not only trained based on data, but also uses additional knowledge and contextual information [17].And then onwards to LLMs and perspective taking:
While LLMs outperform humans in an ever-broadening range of tasks, they remain far behind in the ability to explain somebody else’s feelings, thoughs and behavioral drivers. This skill requires perspective-taking, the process of conceptualizing the point of view of another person.
Foreseeing the actions or reactions of others is also for LLMs a key to choose the best action to take next. Enhancing perspective-taking capabilities of LLMs can unlock their potential to react better and safer to hints of sadness, anger, or distress, to recognize sarcasm, to engage in a more receptive argumentation, or to target an explanation to an audience.What should a LLM do when someone says:
Our analysis reveals that LLMs fail to respond adequately to certain queries, generating erroneous medical information, unsafe recommendations, and content that may be considered offensive [18].Afterwards, many in the audience wanted to know, and had been thinking about, whether it would be possible to give the ''persona embedding'' in the form of a pre-prompt to the LLM.
Map matching refers to the procedure of converting sparse and noisy signals into precise positions on a road network. Drawing inspiration from the methods that propelled success in the text domain, such as language modeling, machine translation, and transfer learning, Dataclair has trained its own sequence-to-sequence Transformer models, which translate mobile network signals into specific road segments.
To transform this into a practical system, several challenges are addressed by developing a set of techniques, including spatial-aware representation of input cell tower sequences, an encoder-decoder framework for map matching model with variable-length input and output [19].See also ''Transformer-based map-matching model with limited labeled data using transfer-learning approach'' by Zhixiong Jin et al. for developing a ''Transformer-based map-matching model with high performance'' [20].
We have developed and studied several algorithms that can find human faces and potentially readable license plates in every frame of a video and anonymize it.Looking at video from ''driver monitoring'' it might be anonymized by just blurring the images. But that is no good, as important information then disappears (such as where is the driver actually looking).
We propose a novel architecture which is able to automatically anonymize faces in images...Again, too much information disappears. In the original image the person might have closed their eyes. Or the person might haved looked away from the road. But that is not preserved on the re-regenerated images (Here, bottom row, the person with the glasses):
...
Our model is based on a conditional generative adversarial network, generating images considering the original pose and image background [21].
GANonymization, a novel face anonymization framework with facial expression-preserving abilities.
...
Additionally, the performance of preserving facial expressions was evaluated on several affect recognition datasets and outperformed the state-of-the-art methods in most categories [22].
ExoMiner is a groundbreaking deep neural network meticulously designed for the classification of transit signals in the search for exoplanets.
ExoMiner is a new deep neural network that leverages NASA's Pleiades supercomputer, and can distinguish real exoplanets from different types of imposters, or ''false positives''. Its design is inspired by various tests and properties human experts use to confirm new exoplanets. And it learns by using past confirmed exoplanets and false positive cases [25].
For missions like Kepler, with thousands of stars in its field of view, each holding the possibility to host multiple potential exoplanets, it’s a hugely time-consuming task to pore over massive datasets. ExoMiner solves this dilemma [25].According to Valizadegan: ''When ExoMiner says something is a planet, you can be sure it's a planet''.
Inpainting is a technique of filling in missing regions of images that involves filling in the missing or damaged parts of an image, or removing the undesired object to construct a complete image [26].On Nvidia's homepage one can find techniques to ''Image Inpainting for Irregular Holes Using Partial Convolutions'' [27] (Nvidia AI playground [28]).
Video Inpainting is a machine-learning task that is defined as filling in masked areas in a video with visually plausible and temporally consistent content. It is commonly used to erase an object from a video [30].See a demo here. Quite similar to the one on display here at the conference.
In this talk, ''small-data'' deep learning models that can be trained with a limited number of cases is introduced. Small-data deep learning is defined as deep learning models that offer the performance equivalent to the ''big-data'' deep-learning models, but require only a small number of cases (< 100) to adequately train, thus, reducing the number of necessary cases by a factor of 100 - 1.000.
In the application to liver tumor segmentation, our small-data deep-learning model achieved the performance equivalent to a world-competition-winning deep-learning model with a very small required number of training cases of only 14.Sure, picking the right small-data is the key to get a good performance.
A RAG system can automatically search your internal data for the most relevant data to answer each query and force the LLM to base its answer entirely on data provided by your defined tools.
RAG is a relatively new and fast evolving technique with lots of contributors. Some common pitfalls and issues tend to crop up regardless of industry.One problem is imbalanced data.
After Czechoslovakia was invaded by Warsaw Pact troops in 1968 and subsequently occupied by the Soviets, figures at the helm of non-conformist culture and political dissent, notably the future president Václav Havel, would congregate here [33].
Lose yourself in the buzz of a classic grand café and let yourself be spoiled by our first-rate staff. While history promenades along Národní Tŕída, Cafe Louvre remains an island of noisy tranquility, a place with a unique atmosphere and traditional menu [34].