Guidelines for Prompting in Langchain

Guidelines for Prompting in Langchain.

Setup

Load the API key and relevant Python libaries.

If you use google colab please install the following packages:

pip install "langchain>=0.0.200" "pandas>=1.5.3" "panel>=1.1.0" "tiktoken>=0.3.3"
import json

from langchain.chat_models import ChatOpenAI
chat = ChatOpenAI(
    # model="gpt-3.5-turbo-0613",
    model="gpt-4",
    temperature=0.0,
    # openai_api_key="sk-<your key here>"  # uncomment to use your own API key, othewise uses default .env key
)
from langchain.prompts import ChatPromptTemplate
paper_info = """
Massively Multilingual Corpus of Sentiment Datasets and Multi-faceted Sentiment Classification Benchmark
Łukasz Augustyniak, Szymon Woźniak, Marcin Gruza, Piotr Gramacki, Krzysztof Rajda, Mikołaj Morzy, Tomasz Kajdanowicz
Despite impressive advancements in multilingual corpora collection and model training, developing large-scale deployments of multilingual models still presents a significant challenge. This is particularly true for language tasks that are culture-dependent. One such example is the area of multilingual sentiment analysis, where affective markers can be subtle and deeply ensconced in culture. This work presents the most extensive open massively multilingual corpus of datasets for training sentiment models. The corpus consists of 79 manually selected datasets from over 350 datasets reported in the scientific literature based on strict quality criteria. The corpus covers 27 languages representing 6 language families. Datasets can be queried using several linguistic and functional features. In addition, we present a multi-faceted sentiment classification benchmark summarizing hundreds of experiments conducted on different base models, training objectives, dataset collections, and fine-tuning strategies.
"""

template_string = """
Perform the following actions for a research paper text: 
1 - Summarize the following text delimited by triple backticks with 1 sentence.
2 - Generate a title for this summary with emojis.
3 - Prepare a tweet thread with 3 tweets based on summary.
4 - Prepare a longer linkedin post based on paper abstract. 

Return a {format_output} with the following strcuture: summary, title, tweet, linkedin_post 

Text:
```{text}```
"""
prompt_template = ChatPromptTemplate.from_template(template_string)
prompt_template
ChatPromptTemplate(input_variables=['text', 'format_output'], output_parser=None, partial_variables={}, messages=[HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=['format_output', 'text'], output_parser=None, partial_variables={}, template='\nPerform the following actions for a research paper text: \n1 - Summarize the following text delimited by triple backticks with 1 sentence.\n2 - Generate a title for this summary with emojis.\n3 - Prepare a tweet thread with 3 tweets based on summary.\n4 - Prepare a longer linkedin post based on paper abstract. \n\nReturn a {format_output} with the following strcuture: summary, title, tweet, linkedin_post \n\nText:\n```{text}```\n', template_format='f-string', validate_template=True), additional_kwargs={})])
prompt_template.input_variables
['text', 'format_output']
prompt_template.messages[0]
HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=['format_output', 'text'], output_parser=None, partial_variables={}, template='\nPerform the following actions for a research paper text: \n1 - Summarize the following text delimited by triple backticks with 1 sentence.\n2 - Generate a title for this summary with emojis.\n3 - Prepare a tweet thread with 3 tweets based on summary.\n4 - Prepare a longer linkedin post based on paper abstract. \n\nReturn a {format_output} with the following strcuture: summary, title, tweet, linkedin_post \n\nText:\n```{text}```\n', template_format='f-string', validate_template=True), additional_kwargs={})
prompt_template.messages[0].prompt.input_variables
['format_output', 'text']
paper_messages = prompt_template.format_messages(
    text=paper_info,  # text to be summarized
    format_output='python dict'  # format of output to be returned from LLM
)
paper_messages
[HumanMessage(content='\nPerform the following actions for a research paper text: \n1 - Summarize the following text delimited by triple backticks with 1 sentence.\n2 - Generate a title for this summary with emojis.\n3 - Prepare a tweet thread with 3 tweets based on summary.\n4 - Prepare a longer linkedin post based on paper abstract. \n\nReturn a python dict with the following strcuture: summary, title, tweet, linkedin_post \n\nText:\n```\nMassively Multilingual Corpus of Sentiment Datasets and Multi-faceted Sentiment Classification Benchmark\nŁukasz Augustyniak, Szymon Woźniak, Marcin Gruza, Piotr Gramacki, Krzysztof Rajda, Mikołaj Morzy, Tomasz Kajdanowicz\nDespite impressive advancements in multilingual corpora collection and model training, developing large-scale deployments of multilingual models still presents a significant challenge. This is particularly true for language tasks that are culture-dependent. One such example is the area of multilingual sentiment analysis, where affective markers can be subtle and deeply ensconced in culture. This work presents the most extensive open massively multilingual corpus of datasets for training sentiment models. The corpus consists of 79 manually selected datasets from over 350 datasets reported in the scientific literature based on strict quality criteria. The corpus covers 27 languages representing 6 language families. Datasets can be queried using several linguistic and functional features. In addition, we present a multi-faceted sentiment classification benchmark summarizing hundreds of experiments conducted on different base models, training objectives, dataset collections, and fine-tuning strategies.\n```\n', additional_kwargs={}, example=False)]
print(type(paper_messages))
print(type(paper_messages[0]))
<class 'list'>
<class 'langchain.schema.HumanMessage'>

Let’s make a first call to the API to check if everything is working.

paper_social_media_summary = chat(paper_messages)

We got not a raw string but an object from langchain.

paper_social_media_summary
AIMessage(content='{\n  "summary": "This research paper presents a massive multilingual corpus of sentiment datasets and a sentiment classification benchmark, covering 27 languages and 6 language families.",\n  "title": "🌍📚 Massively Multilingual Sentiment Analysis Corpus & Benchmark 📈🌐",\n  "tweet": [\n    "🚀 Exciting new research presents a massive multilingual corpus of sentiment datasets, covering 27 languages and 6 language families! 🌍📚 #NLP #SentimentAnalysis",\n    "🔍 The corpus consists of 79 manually selected datasets from over 350 reported in scientific literature, based on strict quality criteria. 📊🧪 #DataScience #Multilingual",\n    "💡 Additionally, the paper introduces a multi-faceted sentiment classification benchmark, summarizing hundreds of experiments on different models, objectives, and strategies. 📈🌐 #MachineLearning #Benchmark"\n  ],\n  "linkedin_post": "🌍📚 Massively Multilingual Sentiment Analysis Corpus & Benchmark 📈🌐\\n\\nA new research paper has been published, presenting the most extensive open massively multilingual corpus of datasets for training sentiment models. The corpus covers 27 languages representing 6 language families and consists of 79 manually selected datasets from over 350 datasets reported in the scientific literature based on strict quality criteria. This is a significant advancement in the field of multilingual sentiment analysis, which is often challenged by culture-dependent language tasks.\\n\\nIn addition to the corpus, the researchers also present a multi-faceted sentiment classification benchmark, summarizing hundreds of experiments conducted on different base models, training objectives, dataset collections, and fine-tuning strategies. This benchmark will serve as a valuable resource for researchers and practitioners working on multilingual sentiment analysis and natural language processing.\\n\\nRead the full paper here: [link to the paper]"\n}', additional_kwargs={}, example=False)
paper_social_media_summary.content
'Summary: 🌍📊 This paper presents a massively multilingual corpus of sentiment datasets consisting of 79 manually selected datasets from over 350 reported in scientific literature, covering 27 languages and a multi-faceted sentiment classification benchmark summarizing hundreds of experiments conducted on different base models, training objectives, dataset collections, and fine-tuning strategies.\n\nTitle: 🌍📊 Massively Multilingual Corpus of Sentiment Datasets and Multi-faceted Sentiment Classification Benchmark\n\nTweet 1: 🌍📊 This paper presents a massively multilingual corpus of sentiment datasets covering 27 languages and a multi-faceted sentiment classification benchmark summarizing hundreds of experiments conducted on different base models, training objectives, dataset collections, and fine-tuning strategies. #sentimentanalysis #multilingual\n\nTweet 2: 📊 The corpus consists of 79 manually selected datasets from over 350 reported in scientific literature based on strict quality criteria, and datasets can be queried using several linguistic and functional features. #naturallanguageprocessing #datasets\n\nTweet 3: 🌍📈 The multi-faceted sentiment classification benchmark presented in this paper can be used to evaluate the performance of different sentiment analysis models and fine-tuning strategies. #machinelearning #benchmarking\n\nLinkedin Post: \nThis paper presents a massively multilingual corpus of sentiment datasets and a multi-faceted sentiment classification benchmark, which can be used to evaluate the performance of different sentiment analysis models and fine-tuning strategies. The corpus consists of 79 manually selected datasets from over 350 reported in scientific literature based on strict quality criteria, covering 27 languages representing 6 language families. Datasets can be queried using several linguistic and functional features. The multi-faceted sentiment classification benchmark summarizes hundreds of experiments conducted on different base models, training objectives, dataset collections, and fine-tuning strategies. This work is a significant contribution to the development of large-scale deployments of multilingual sentiment models, which still presents a significant challenge due to the culture-dependent nature of language tasks such as sentiment analysis. #sentimentanalysis #multilingual #naturallanguageprocessing #machinelearning #benchmarking'
chat(prompt_template.format_messages(
    text=paper_info,
    format_output='markdown table'
))
AIMessage(content='| Summary | Title | Tweet | LinkedIn Post |\n| --- | --- | --- | --- |\n| This paper presents a massively multilingual corpus of sentiment datasets consisting of 79 manually selected datasets from over 350 datasets reported in the scientific literature based on strict quality criteria, covering 27 languages representing 6 language families, and a multi-faceted sentiment classification benchmark summarizing hundreds of experiments conducted on different base models, training objectives, dataset collections, and fine-tuning strategies. | 🌎📊👍 A Massive Multilingual Sentiment Corpus and Classification Benchmark | 1/3: Check out this paper presenting a massively multilingual corpus of sentiment datasets and a multi-faceted sentiment classification benchmark! 🌎📊👍 #multilingual #sentimentanalysis #corpus #classificationbenchmark | This paper presents a massively multilingual corpus of sentiment datasets and a multi-faceted sentiment classification benchmark, which can be useful for developing large-scale deployments of multilingual models, particularly for language tasks that are culture-dependent, such as multilingual sentiment analysis. The corpus consists of 79 manually selected datasets from over 350 datasets reported in the scientific literature based on strict quality criteria, covering 27 languages representing 6 language families. Datasets can be queried using several linguistic and functional features. The multi-faceted sentiment classification benchmark summarizes hundreds of experiments conducted on different base models, training objectives, dataset collections, and fine-tuning strategies, providing a comprehensive evaluation of the state-of-the-art in multilingual sentiment analysis. 🌎📊👍 #multilingual #sentimentanalysis #corpus #classificationbenchmark |\n| 2/3: The corpus covers 27 languages representing 6 language families and can be queried using several linguistic and functional features. 🌎📊👍 #multilingual #sentimentanalysis #corpus #classificationbenchmark | 3/3: The multi-faceted sentiment classification benchmark provides a comprehensive evaluation of the state-of-the-art in multilingual sentiment analysis. 🌎📊👍 #multilingual #sentimentanalysis #corpus #classificationbenchmark | This paper presents a massively multilingual corpus of sentiment datasets and a multi-faceted sentiment classification benchmark, which can be useful for developing large-scale deployments of multilingual models, particularly for language tasks that are culture-dependent, such as multilingual sentiment analysis. The corpus consists of 79 manually selected datasets from over 350 datasets reported in the scientific literature based on strict quality criteria, covering 27 languages representing 6 language families. Datasets can be queried using several linguistic and functional features. The multi-faceted sentiment classification benchmark summarizes hundreds of experiments conducted on different base models, training objectives, dataset collections, and fine-tuning strategies, providing a comprehensive evaluation of the state-of-the-art in multilingual sentiment analysis. The corpus covers 27 languages representing 6 language families and can be queried using several linguistic and functional features. The multi-faceted sentiment classification benchmark provides a comprehensive evaluation of the state-of-the-art in multilingual sentiment analysis. 🌎📊👍 #multilingual #sentimentanalysis #corpus #classificationbenchmark |', additional_kwargs={}, example=False)

Chains

import asyncio

from langchain.llms import OpenAI
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain
text = """
US and Canadian search teams are racing against time to find a tourist submarine that went missing during a dive to the Titanic's wreck on Sunday.

Five people were onboard when contact with the small sub was lost about an hour and 45 minutes into its dive.

The rescue operation is continuing overnight in the mid-Atlantic but there has been no sign so far of the vessel.

Government agencies, both countries' navies and commercial deep-sea firms are all helping the rescue operation.
"""

do_whats = ["summarize", "extract NERs", "extract keywords", "extract key sentences", "extract random words starting with 's'"]

prompt = PromptTemplate(
    input_variables=["do_what", "text"],
    template="Please {do_what} the following text: {text}",
)
llm = OpenAI(temperature=0.9)
chain = LLMChain(llm=llm, prompt=prompt, verbose=True)
# llm
# chain
print(chain.run(do_what="extract ner", text=text))


> Entering new  chain...
Prompt after formatting:
Please extract ner the following text: 
US and Canadian search teams are racing against time to find a tourist submarine that went missing during a dive to the Titanic's wreck on Sunday.

Five people were onboard when contact with the small sub was lost about an hour and 45 minutes into its dive.

The rescue operation is continuing overnight in the mid-Atlantic but there has been no sign so far of the vessel.

Government agencies, both countries' navies and commercial deep-sea firms are all helping the rescue operation.


> Finished chain.

Person: Five people 
Organization: US, Canadian, navies, commercial deep-sea firms 
Location: mid-Atlantic
for do_what in do_whats:
    print(f"Doing {do_what}...")
    print(chain.run(do_what=do_what, text=text))
    print("*"*100)
Doing summarize...

US and Canadian search teams are working urgently to find a tourist submarine that went missing during a dive near the Titanic's wreck site on Sunday, with five people onboard. Despite efforts from government agencies, navies and commercial deep-sea firms, there has been no sign of the vessel thus far. The rescue operation is continuing overnight in the mid-Atlantic.
****************************************************************************************************
Doing extract NERs...

NERs: US, Canadian, tourist, submarine, Titanic, wreck, Five people, sub, mid-Atlantic, government agencies, both countries' navies, commercial deep-sea firms
****************************************************************************************************
Doing extract keywords...

1. US 
2. Canadian 
3. Tourist Submarine 
4. Titanic's Wreck 
5. Dive 
6. Five People 
7. Mid-Atlantic 
8. Government Agencies 
9. Navies 
10. Commercial Deep-Sea Firms
****************************************************************************************************
Doing extract key sentences...
1. US and Canadian search teams are racing against time to find a tourist submarine that went missing during a dive to the Titanic's wreck on Sunday.
2. Five people were onboard when contact with the small sub was lost about an hour and 45 minutes into its dive. 
3. Government agencies, both countries' navies and commercial deep-sea firms are all helping the rescue operation.
****************************************************************************************************
Doing extract random words starting with 's'...

Search, Sunday, Submarine, Sub, Submersible, Systematic, Studies, Spend, Supported, Scheduled, Salvage
****************************************************************************************************
22.1 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each)
tasks = [chain.arun(do_what=do_what, text=text) for do_what in do_whats]
await asyncio.gather(*tasks)
/tmp/ipykernel_3555286/2562969474.py:2: RuntimeWarning: coroutine 'Chain.arun' was never awaited
  tasks = [chain.arun(do_what=do_what, text=text) for do_what in do_whats]
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
["\nSearch teams from the US and Canada are racing against time to locate a tourist submarine with 5 people onboard that went missing during a dive to the Titanic's wreck on Sunday. The rescue operation is continuing overnight in the mid-Atlantic with the help of government agencies, both countries' navies and commercial deep-sea firms, but so far there has been no sign of the vessel.",
 "\nNERs: US, Canadian, search teams, tourist submarine, dive, Titanic's wreck, Five people, small sub, mid-Atlantic, government agencies, both countries' navies, commercial deep-sea firms",
 '\nKeywords: US, Canadian, search teams, tourist submarine, dive, Titanic, wreck, Sunday, five people, mid-Atlantic, government agencies, navies, commercial deep-sea firms, rescue operation',
 "\n1. US and Canadian search teams are racing against time to find a tourist submarine that went missing during a dive to the Titanic's wreck on Sunday.\n2. Five people were onboard when contact with the small sub was lost about an hour and 45 minutes into its dive.\n3. Government agencies, both countries' navies and commercial deep-sea firms are all helping the rescue operation.",
 "\nSearch, Sunday, submarine, small, sign, sub, Sunday's, governments, navies, commercial"]

LangChain: Memory

One of the most common use cases for LLMs is to use it as a chatbot. However, LLMs are stateless hence there is no memory of previous calls to the API. We must create a memory for the LLM to be able to remember previous calls.

ConversationBufferMemory

import warnings
warnings.filterwarnings('ignore')

from langchain.chat_models import ChatOpenAI
from langchain.chains import ConversationChain
from langchain.memory import ConversationBufferMemory
llm = ChatOpenAI(temperature=0.0)
memory = ConversationBufferMemory()
conversation = ConversationChain(
    llm=llm, 
    memory = memory,
    verbose=True
)
conversation.predict(input="Hi, my name is Łukasz")


> Entering new  chain...
Prompt after formatting:
The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.

Current conversation:

Human: Hi, my name is Łukasz
AI:

> Finished chain.
Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 1.0 seconds as it raised ServiceUnavailableError: The server is overloaded or not ready yet..
"Hello Łukasz, it's nice to meet you! My name is AI. How can I assist you today?"
conversation.predict(input="What is the best joke ever?")


> Entering new  chain...
Prompt after formatting:
The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.

Current conversation:
Human: Hi, my name is Łukasz
AI: Hello Łukasz, it's nice to meet you! My name is AI. How can I assist you today?
Human: What is the best joke ever?
AI:

> Finished chain.
'That\'s a subjective question, as humor is different for everyone. However, one of the most popular jokes of all time is "Why did the chicken cross the road? To get to the other side!"'
conversation.predict(input="What is my name?")


> Entering new  chain...
Prompt after formatting:
The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.

Current conversation:
Human: Hi, my name is Łukasz
AI: Hello Łukasz, it's nice to meet you! My name is AI. How can I assist you today?
Human: What is the best joke ever?
AI: That's a subjective question, as humor is different for everyone. However, one of the most popular jokes of all time is "Why did the chicken cross the road? To get to the other side!"
Human: What is my name?
AI:

> Finished chain.
'Your name is Łukasz, as you mentioned earlier.'
print(memory.buffer)
Human: Hi, my name is Łukasz
AI: Hello Łukasz, it's nice to meet you! My name is AI. How can I assist you today?
Human: What is the best joke ever?
AI: That's a subjective question, as humor is different for everyone. However, one of the most popular jokes of all time is "Why did the chicken cross the road? To get to the other side!"
Human: What is my name?
AI: Your name is Łukasz, as you mentioned earlier.
memory.load_memory_variables({})
{'history': 'Human: Hi, my name is Łukasz\nAI: Hello Łukasz, it\'s nice to meet you! My name is AI. How can I assist you today?\nHuman: What is the best joke ever?\nAI: That\'s a subjective question, as humor is different for everyone. However, one of the most popular jokes of all time is "Why did the chicken cross the road? To get to the other side!"\nHuman: What is my name?\nAI: Your name is Łukasz, as you mentioned earlier.'}
memory = ConversationBufferMemory()
memory.save_context(
    {"input": "Hi Joey!"}, 
    {"output": "How you doin'?"}
)
print(memory.buffer)
Human: Hi Joey!
AI: How you doin'?
memory.load_memory_variables({})
{'history': "Human: Hi Joey!\nAI: How you doin'?"}
memory.save_context(
    {"input": "Awesome bro!"}, 
    {"output": "Do want a sandwich with salami?"}
)
memory.load_memory_variables({})
{'history': "Human: Hi Joey!\nAI: How you doin'?\nHuman: Awesome bro!\nAI: Do want a sandwich with salami?"}

ConversationBufferWindowMemory

from langchain.memory import ConversationBufferWindowMemory
memory = ConversationBufferWindowMemory(k=1)               

memory.save_context(
    {"input": "Hi Joey!"}, 
    {"output": "How you doin'?"}
)
memory.save_context(
    {"input": "Awesome bro!"}, 
    {"output": "Do want a sandwich with salami?"}
)
memory.load_memory_variables({})
{'history': 'Human: Awesome bro!\nAI: Do want a sandwich with salami?'}
llm = ChatOpenAI(temperature=0.0)
memory = ConversationBufferWindowMemory(k=1)
conversation = ConversationChain(
    llm=llm, 
    memory = memory,
    verbose=False
)
conversation.predict(input="Hi, my name is Lukasz")
"Hello Lukasz, it's nice to meet you. My name is AI. How can I assist you today?"
conversation.predict(input="Placeholder for a very, very important question")
"I'm sorry, Lukasz, but I'm not sure I understand your question. Could you please provide me with more context or details so I can better assist you?"
conversation.predict(input="What is my name?")
'Your name is Lukasz.'
conversation.predict(input="Have I been asking for placeholders?")
"I'm sorry, I don't have enough context to answer that question. Could you please provide more information?"
conversation.predict(input="Nevermind! Do you know me?")
Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 1.0 seconds as it raised ServiceUnavailableError: The server is overloaded or not ready yet..
Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 2.0 seconds as it raised RateLimitError: That model is currently overloaded with other requests. You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID 97b35ddd62d28fcf0b82fc4ccf4d093b in your message.).
"Yes, I have access to information about you based on our interactions. I know your name, some of your preferences, and some of the topics we have discussed in the past. However, I don't have access to your personal information or anything that you haven't shared with me."
conversation.predict(input="Do you remember my name?")
'Yes, your name is [insert name here].'

Welcom to the workshop lead by [insert name here] :)

ConversationTokenBufferMemory

from langchain.memory import ConversationTokenBufferMemory
from langchain.llms import OpenAI
llm = ChatOpenAI(temperature=0.0)

memory = ConversationTokenBufferMemory(llm=llm, max_token_limit=30)

memory.save_context(
    {"input": "Hi Joey!"}, 
    {"output": "How you doin'?"}
)
memory.save_context(
    {"input": "Awesome bro!"}, 
    {"output": "Do want a sandwich with salami?"}
)

memory.load_memory_variables({})
{'history': 'Human: Awesome bro!\nAI: Do want a sandwich with salami?'}

ConversationSummaryMemory

from langchain.memory import ConversationSummaryBufferMemory
chatbot_system_prompt = """
Jesteś asystentem AI Szkoły Letniej, pomagasz uczestnikom wybrać najlepsze warsztaty. 

###

Workshops:
Bartosz Kolasa  MLOps   Systematizing a research code aka introduction to Kedro framework   During the workshops I would like to present the Kedro framework which is a MLOps tool to systematize any data science research project into a pipeline represented by a DAG (directed acyclic graph). Such an approach helps in creating more reproducible experiments that could be much more easily moved from your laptop to processing on a bigger cluster or in the cloud.
Łukasz Augustyniak  Prompt Engineering  Large Language Models - from Demo to Production "In this interactive workshop, we will delve into the fascinating world of large language models and explore their potential in revolutionizing various industries. I will guide participants through the process of transforming cutting-edge demos into scalable production solutions.

Participants will gain hands-on experience by working on practical exercises that demonstrate how to fine-tune these models for specific tasks. Additionally, we'll cover best practices for deploying these models at scale while maintaining efficiency and performance.

Throughout the workshop, attendees can expect engaging discussions about ethical considerations surrounding AI usage as well as insights into future developments within the field. By the end of this session, participants should have a solid understanding of how to harness the power of large language models effectively in order to drive innovation across various domains."
Arkadiusz Janz  Generative Language Models  Training Large Language Models with Reinforcement Learning from Human Feedback (RLHF)   A comprehensive introduction to Generative Language Models and Reinforcement Learning from Human Feedback: a novel approach in training Large Language Models for downstream tasks. This workshop is designed to impart an in-depth understanding of fundamental concepts of Reinforcement Learning (states, actions, rewards, value functions, policies) and Generative Language Models. A theoretical comparison with Supervised Learning paradigm will be discussed, along with the advantages RLHF optimization brings to reducing biases, and overcoming sparse reward issues. Participants will engage in hands-on activities involving RLHF training with simplified models, hyperparameter tuning of RLHF models, and diving into existing RLHF programming frameworks.
Konrad Wojtasik Information Retrieval   Introduction to modern information retrieval    Information retrieval plays a crucial role in modern systems, finding applications across diverse domains and industries. Its relevance spans from web search and recommendation systems to product search and health and legal information retrieval. Information retrieval is not only essential for traditional search applications but also plays a vital role in retrieval-augmented Question Answering systems. Additionally, it serves as a valuable mechanism to prevent Large Language Models from generating incorrect or hallucinated information. Moreover, it ensures that their knowledge remains accurate and up-to-date. During this workshop, participants will have the opportunity to explore and understand current state-of-the-art models used in information retrieval. They will gain insights into the strengths and limitations of these models. Furthermore, the workshop will focus on setting up an information retrieval pipeline, allowing participants to gain hands-on experience in building and implementing such systems. Additionally, participants will learn how to effectively measure and evaluate the performance of their information retrieval pipelines.
Mateusz Gniewkowski XAI Model Agnostic Explanations Techniques  "Machine learning models can often be complex and difficult to understand, therefore it is important to be able to explain how these models work, as they are increasingly used in a wide range of industries and applications.
The workshop will start by discussing some basic ways to explain machine learning models, such as using feature importance measures, decision trees, and visualization tools. However, the focus will then shift to model-agnostic techniques, which can be applied to any type of machine learning model.
The techniques that will be covered in the workshop include LIME (Local Interpretable Model-Agnostic Explanations) and SHAP (SHapley Additive exPlanations). These libraries are designed to provide more transparent and understandable explanations for machine learning models, even when the models themselves are complex or difficult to interpret."
Piotr Bielak    Representation learning Introduction to graph representation learning   In recent years, representation learning has attracted much attention both in the research community and industrial applications. Learning representations for graphs is especially challenging due to the relational nature of such data, i.e., one must reflect both the rich attribute space and graph structure in the embedding vectors. During this workshop, I will show how to use the PyTorch-Geometric library to easily build graph representations and solve a variety of applications. We will explore node, edge and graph-level representations through the prism of their associated downstream tasks and corresponding deep learning models (Graph Neural Networks).
Denis Janiak    Representation learning, Bayesian methods   Does Representation Know What It Doesn't Know?  "Uncertainty estimation is a critical aspect of artificial intelligence systems, enabling them to quantify their confidence and provide reliable predictions. However, accurately assessing uncertainty becomes increasingly challenging when AI models encounter scenarios outside their training data distribution. This workshop, titled ""Does Representation Know What It Doesn't Know?,"" aims to explore the concept of uncertainty estimation in AI systems and delve into the question of whether representations within these systems possess the ability to recognize their own limitations. During the workshop, we will investigate the various techniques and methodologies employed in uncertainty estimation, such as Bayesian approaches and deep learning-based techniques. We will analyze the strengths and limitations of these approaches and discuss their implications for real-world applications.
Furthermore, the workshop will delve into the concept of representation learning and its impact on uncertainty estimation. We will examine whether AI systems can effectively recognize when they are faced with novel or out-of-distribution inputs. Additionally, we will explore approaches to measure and improve representation awareness, enabling models to identify areas of uncertainty and seek further guidance or human intervention when necessary.
By the end of the workshop, attendees will gain a deeper understanding of the state-of-the-art techniques for uncertainty estimation and its importance in building robust AI systems. They will also gain insights into the fundamental question of whether representations within AI models possess the capability to identify areas of uncertainty and adapt accordingly. "
Albert Sawczyn  Representation learning Knowledge Graph Representation Learning Knowledge graphs have emerged as powerful tools for organizing and representing structured information in various domains, enabling efficient data integration, inference, and knowledge discovery. Knowledge graph representation learning aims to capture the rich semantic relationships and contextual information within knowledge graphs, facilitating effective knowledge inference and reasoning. This workshop aims to introduce the fundamental challenge of learning representations for knowledge graphs and highlight their significance in practical applications. Practical demonstrations will show how to easily learn representation using the PyKEEN library and how to apply it to a real-world NLP problem. 
Jakub Binkowski Representation learning Generative models for graphs    After many advancements in the realm of Graph Representation Learning, graph generation gained much attention due to its vast range of applications (e.g. drug design). Nonetheless, due to the nature of graph data, this task is very difficult and further breakthroughs still need to be discovered. Hence the workshop will provide a ground understanding of the selected methods and problems associated with graph generation. During the workshop, I will show the most important methods in theory and practice. I will show how to implement these methods leveraging Pytorch Geometric library. We will go through training and evaluation using common datasets.
Kamil Kanclerz  NLP, Personalization    Subjective problems in NLP  "A unified gold standard commonly exploited in natural language processing (NLP) tasks requires high inter-annotator agreement. However, there are many subjective problems that should respect users’ individual points of view. At the first glance, disagreement and non-regular annotations can be seen as noise that drags the performance of NLP task detection models down. As we know, the ability to think and perceive the environment differently is natural to humans as such. Therefore, it is crucial to include this observation while building predictive models in order to reflect the setup close to reality. As simple as this may seem, it is important to keep in mind that the key ideas behind NLP phenomenon detection, such as gold standard, agreement coefficients, or the evaluation itself need to be thoroughly analyzed and reconsidered especially for subjective NLP tasks like hate speech detection, prediction of emotional elicitation, sense of humor, sarcasm detection, or even sentiment analysis. Such NLP tasks come with each complexity of their own, especially within the aspect of subjectivity, therefore making them difficult to solve compared to non-subjective tasks.

During the workshop, the participants will be introduced to the novel deep neural architectures leveraging various user representations. Moreover, the user-centered data setups will be explained in comparison to their ground truth equivalents. Additionally, the personalized evaluation techniques will be presented as the methods providing further insight into model ability to understand differences between various user perspectives."
Mateusz Wójcik  MLOps, continual learning   Continual Learning - techniques and applications    "Recently, neural architectures have become effective and widely used in various domains. The parameter optimization process based on gradient descent works well when the data set is sufficiently large and fully available during the training process. But what if we don’t have all the data available during training? What if the number of classes increase? As a result, we have to manually retrain the models from scratch ensuing a time-consuming process.

During this workshop you will learn about the Continual Learning and its applications. We will discuss the catastrophic forgetting and explore various techniques that trying to prevent it starting from simple neural networks up to modern LLMs. As a result, you will understand why we need Continual Learning and how to apply it to existing or new models."
Patryk Wielopolski  Generative Models   Conditional object generation using pre-trained models and plug-in networks Generative models have gained many Machine Learning practitioners’ attention in the last years resulting in models such as StyleGAN for human face generation or PointFlow for the 3D point cloud generation. However, by default, we cannot control its sampling process, i.e., we cannot generate a sample with a specific set of attributes. The current approach is model retraining with additional inputs and different architecture, which requires time and computational resources. During this hands-on workshop we will go through a method which enables to generate objects with a given set of attributes without retraining the base model. For this purpose, we will utilize the normalizing flow models - Conditional Masked Autoregressive Flow and Conditional Real NVP, and plug-in networks resulting in the Flow Plugin Network.
Michał Czuba    Network Science Complex networks part II - spreading processes  Two years ago, the world faced SARS-CoV-2 and the biggest pandemic in the century. Since last winter, with an incursion of Russian troops in Ukraine, all civilised countries have been subjected to misinformation. This year with an election in Poland, a festival of campaign promises has started. The nature of these three examples is complex and hard to analyse. Nonetheless, one of the approaches leading to understanding and controlling such processes is a network simulation. During this workshop, you will learn an essential toolkit to model and analyse spreading phenomena in complex networks. You will understand how to simulate such processes as epidemics or opinion dynamics and how to identify key spreaders of fake news or the most fragile individuals to be vaccinated in the first place.
Mateusz Nurek   Network Science Complex networks part I - social network analysis   Computational network science is a field of artificial intelligence that analyses graphs in applied problems involving social, transportation, epidemiological or energy issues. This workshop will teach you fundamental tools and techniques for analysing this data type. Based on a case study - the history of communication in a particular company, we will solve the problem of optimising the structure of its organisation. We will detect natural teams from employees most intensively working together. We will also identify key personnel, i.e. employees whose loss can cause communication paralysis.
Damian Serwata  Network Science "Complex networks I - social network analysis
Complex networks II - spreading processes"  
Michał Karol    ML w medycynie  Computer Vision for medical image processing    Computer vision has emerged as a revolutionary technology in the medical field, bringing significant transformations in various aspects of healthcare. Its application in clinical practice has paved the way for improved diagnostics, more accurate disease detection, and enhanced treatment planning. The objective of this workshop is to bring comprehensive understanding of the impact of computer vision in clinical practice. Participants will gain insights into how this technology is reshaping healthcare and improving patient outcomes. By exploring the latest advancements in certified medical systems, attendees will learn about the integration of computer vision into existing medical frameworks and protocols. Moreover, the workshop will delve into current research areas within computer vision in medicine. Participants will be introduced to cutting-edge studies and ongoing projects that aim to further enhance the capabilities of computer vision in the healthcare domain. In the second part of the workshop, there will be an interactive session focused on implementing classification and segmentation networks using the JAX framework and the Flax library. 
Piotr Kawa  Analiza dźwięku (TTS, DF)   Generating audio DeepFakes and how to detect them   Recent advances in audio processing and speech synthesis allow the creation of realistic speech - DeepFakes. Despite a number of advantages, this technology poses a threat through its potential applications including disinformation spreading. Participants in this workshop will learn about the latest technologies for speech generation and then how to defend themselves against the malicious use of this technology using state-of-the-art DeepFake detection techniques.

"""
memory = ConversationSummaryBufferMemory(llm=llm, max_token_limit=2000)
memory.save_context(
    {"input": "Cześć"}, 
    {"output": "Cześć, jestem asystentem studenta na szkole letniej AI Tech. Pomogę znaleźć Ci odpowiednie warsztaty i wykłady."}
)
memory.save_context(
    {"input": "Szukam warsztatów"},
    {"output": f"Pewnie chodzi Ci o te super warsztaty na szkole letniej AI tech? Na jaki temat szukasz warsztatów? Możliwe to: {chatbot_system_prompt}"}
)

memory.load_memory_variables({})
{'history': 'System: The human greets the AI in Polish and the AI responds, introducing itself as an assistant for the AI Tech summer school. The human expresses interest in workshops and the AI provides a list of available workshops with brief descriptions. The workshops cover topics such as MLOps, large language models, generative language models, information retrieval, model agnostic explanation techniques, representation learning, Bayesian methods, NLP, personalization, continual learning, generative models, network science, and computer vision for medical image processing. The AI also mentions a workshop on generating audio DeepFakes and how to detect them.'}
conversation = ConversationChain(
    llm=llm, 
    memory = memory,
    verbose=True
)

conversation.predict(input="jest coś z Large language models?")


> Entering new  chain...
Prompt after formatting:
The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.

Current conversation:
System: The human greets the AI in Polish and the AI responds, introducing itself as an assistant for the AI Tech summer school. The human expresses interest in workshops and the AI provides a list of available workshops with brief descriptions. The workshops cover topics such as MLOps, large language models, generative language models, information retrieval, model agnostic explanation techniques, representation learning, Bayesian methods, NLP, personalization, continual learning, generative models, network science, and computer vision for medical image processing. The AI also mentions a workshop on generating audio DeepFakes and how to detect them.
Human: jest coś z Large language models?
AI:

> Finished chain.
'Tak, mamy warsztat dotyczący dużych modeli językowych. W tym warsztacie uczestnicy będą mieli okazję nauczyć się, jak budować i trenować modele językowe o dużej skali, takie jak GPT-3. Będziemy omawiać różne techniki i narzędzia, które pomogą w tworzeniu i optymalizacji tych modeli. Warsztat ten będzie prowadzony przez doświadczonych specjalistów z dziedziny uczenia maszynowego i będzie składał się z wykładów, ćwiczeń praktycznych i dyskusji.'
conversation.predict(input="a kto go prowadzi?")


> Entering new  chain...
Prompt after formatting:
The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.

Current conversation:
System: The human greets the AI in Polish and the AI responds, introducing itself as an assistant for the AI Tech summer school. The human expresses interest in workshops and the AI provides a list of available workshops with brief descriptions. The workshops cover topics such as MLOps, large language models, generative language models, information retrieval, model agnostic explanation techniques, representation learning, Bayesian methods, NLP, personalization, continual learning, generative models, network science, and computer vision for medical image processing. The AI also mentions a workshop on generating audio DeepFakes and how to detect them.
Human: jest coś z Large language models?
AI: Tak, mamy warsztat dotyczący dużych modeli językowych. W tym warsztacie uczestnicy będą mieli okazję nauczyć się, jak budować i trenować modele językowe o dużej skali, takie jak GPT-3. Będziemy omawiać różne techniki i narzędzia, które pomogą w tworzeniu i optymalizacji tych modeli. Warsztat ten będzie prowadzony przez doświadczonych specjalistów z dziedziny uczenia maszynowego i będzie składał się z wykładów, ćwiczeń praktycznych i dyskusji.
Human: a kto go prowadzi?
AI:

> Finished chain.
'Warsztat dotyczący dużych modeli językowych będzie prowadzony przez dr. Johna Smitha, który jest ekspertem w dziedzinie uczenia maszynowego i ma wiele lat doświadczenia w pracy z dużymi modelami językowymi. Dr. Smith jest autorem wielu publikacji naukowych na ten temat i jest znany z prowadzenia interaktywnych i praktycznych warsztatów.'
memory.load_memory_variables({})
{'history': 'System: The human greets the AI in Polish and the AI responds, introducing itself as an assistant for the AI Tech summer school. The human expresses interest in workshops and the AI provides a list of available workshops with brief descriptions. The workshops cover topics such as MLOps, large language models, generative language models, information retrieval, model agnostic explanation techniques, representation learning, Bayesian methods, NLP, personalization, continual learning, generative models, network science, and computer vision for medical image processing. The AI also mentions a workshop on generating audio DeepFakes and how to detect them.\nHuman: jest coś z Large language models?\nAI: Tak, mamy warsztat dotyczący dużych modeli językowych. W tym warsztacie uczestnicy będą mieli okazję nauczyć się, jak budować i trenować modele językowe o dużej skali, takie jak GPT-3. Będziemy omawiać różne techniki i narzędzia, które pomogą w tworzeniu i optymalizacji tych modeli. Warsztat ten będzie prowadzony przez doświadczonych specjalistów z dziedziny uczenia maszynowego i będzie składał się z wykładów, ćwiczeń praktycznych i dyskusji.\nHuman: a kto go prowadzi?\nAI: Warsztat dotyczący dużych modeli językowych będzie prowadzony przez dr. Johna Smitha, który jest ekspertem w dziedzinie uczenia maszynowego i ma wiele lat doświadczenia w pracy z dużymi modelami językowymi. Dr. Smith jest autorem wielu publikacji naukowych na ten temat i jest znany z prowadzenia interaktywnych i praktycznych warsztatów.'}

Where is our workshop list?

from langchain.memory import ConversationBufferMemory
from langchain import OpenAI, LLMChain, PromptTemplate
template = chatbot_system_prompt + """

Historia Rozmowy:
{chat_history}
Student: {human_input}
Asystent:"""

prompt = PromptTemplate(
    input_variables=["chat_history", "human_input"], template=template
)
memory = ConversationBufferMemory(memory_key="chat_history")
llm_chain = LLMChain(
    llm=OpenAI(),
    prompt=prompt,
    verbose=True,
    memory=memory,
)
memory.load_memory_variables({})
{'chat_history': ''}
llm_chain.predict(human_input="jest coś z Large language models?")


> Entering new  chain...
Prompt after formatting:

###

Workshops:
Bartosz Kolasa  MLOps   Systematizing a research code aka introduction to Kedro framework   During the workshops I would like to present the Kedro framework which is a MLOps tool to systematize any data science research project into a pipeline represented by a DAG (directed acyclic graph). Such an approach helps in creating more reproducible experiments that could be much more easily moved from your laptop to processing on a bigger cluster or in the cloud.
Łukasz Augustyniak  Prompt Engineering  Large Language Models - from Demo to Production "In this interactive workshop, we will delve into the fascinating world of large language models and explore their potential in revolutionizing various industries. I will guide participants through the process of transforming cutting-edge demos into scalable production solutions.

Participants will gain hands-on experience by working on practical exercises that demonstrate how to fine-tune these models for specific tasks. Additionally, we'll cover best practices for deploying these models at scale while maintaining efficiency and performance.

Throughout the workshop, attendees can expect engaging discussions about ethical considerations surrounding AI usage as well as insights into future developments within the field. By the end of this session, participants should have a solid understanding of how to harness the power of large language models effectively in order to drive innovation across various domains."
Arkadiusz Janz  Generative Language Models  Training Large Language Models with Reinforcement Learning from Human Feedback (RLHF)   A comprehensive introduction to Generative Language Models and Reinforcement Learning from Human Feedback: a novel approach in training Large Language Models for downstream tasks. This workshop is designed to impart an in-depth understanding of fundamental concepts of Reinforcement Learning (states, actions, rewards, value functions, policies) and Generative Language Models. A theoretical comparison with Supervised Learning paradigm will be discussed, along with the advantages RLHF optimization brings to reducing biases, and overcoming sparse reward issues. Participants will engage in hands-on activities involving RLHF training with simplified models, hyperparameter tuning of RLHF models, and diving into existing RLHF programming frameworks.
Konrad Wojtasik Information Retrieval   Introduction to modern information retrieval    Information retrieval plays a crucial role in modern systems, finding applications across diverse domains and industries. Its relevance spans from web search and recommendation systems to product search and health and legal information retrieval. Information retrieval is not only essential for traditional search applications but also plays a vital role in retrieval-augmented Question Answering systems. Additionally, it serves as a valuable mechanism to prevent Large Language Models from generating incorrect or hallucinated information. Moreover, it ensures that their knowledge remains accurate and up-to-date. During this workshop, participants will have the opportunity to explore and understand current state-of-the-art models used in information retrieval. They will gain insights into the strengths and limitations of these models. Furthermore, the workshop will focus on setting up an information retrieval pipeline, allowing participants to gain hands-on experience in building and implementing such systems. Additionally, participants will learn how to effectively measure and evaluate the performance of their information retrieval pipelines.
Mateusz Gniewkowski XAI Model Agnostic Explanations Techniques  "Machine learning models can often be complex and difficult to understand, therefore it is important to be able to explain how these models work, as they are increasingly used in a wide range of industries and applications.
The workshop will start by discussing some basic ways to explain machine learning models, such as using feature importance measures, decision trees, and visualization tools. However, the focus will then shift to model-agnostic techniques, which can be applied to any type of machine learning model.
The techniques that will be covered in the workshop include LIME (Local Interpretable Model-Agnostic Explanations) and SHAP (SHapley Additive exPlanations). These libraries are designed to provide more transparent and understandable explanations for machine learning models, even when the models themselves are complex or difficult to interpret."
Piotr Bielak    Representation learning Introduction to graph representation learning   In recent years, representation learning has attracted much attention both in the research community and industrial applications. Learning representations for graphs is especially challenging due to the relational nature of such data, i.e., one must reflect both the rich attribute space and graph structure in the embedding vectors. During this workshop, I will show how to use the PyTorch-Geometric library to easily build graph representations and solve a variety of applications. We will explore node, edge and graph-level representations through the prism of their associated downstream tasks and corresponding deep learning models (Graph Neural Networks).
Denis Janiak    Representation learning, Bayesian methods   Does Representation Know What It Doesn't Know?  "Uncertainty estimation is a critical aspect of artificial intelligence systems, enabling them to quantify their confidence and provide reliable predictions. However, accurately assessing uncertainty becomes increasingly challenging when AI models encounter scenarios outside their training data distribution. This workshop, titled ""Does Representation Know What It Doesn't Know?,"" aims to explore the concept of uncertainty estimation in AI systems and delve into the question of whether representations within these systems possess the ability to recognize their own limitations. During the workshop, we will investigate the various techniques and methodologies employed in uncertainty estimation, such as Bayesian approaches and deep learning-based techniques. We will analyze the strengths and limitations of these approaches and discuss their implications for real-world applications.
Furthermore, the workshop will delve into the concept of representation learning and its impact on uncertainty estimation. We will examine whether AI systems can effectively recognize when they are faced with novel or out-of-distribution inputs. Additionally, we will explore approaches to measure and improve representation awareness, enabling models to identify areas of uncertainty and seek further guidance or human intervention when necessary.
By the end of the workshop, attendees will gain a deeper understanding of the state-of-the-art techniques for uncertainty estimation and its importance in building robust AI systems. They will also gain insights into the fundamental question of whether representations within AI models possess the capability to identify areas of uncertainty and adapt accordingly. "
Albert Sawczyn  Representation learning Knowledge Graph Representation Learning Knowledge graphs have emerged as powerful tools for organizing and representing structured information in various domains, enabling efficient data integration, inference, and knowledge discovery. Knowledge graph representation learning aims to capture the rich semantic relationships and contextual information within knowledge graphs, facilitating effective knowledge inference and reasoning. This workshop aims to introduce the fundamental challenge of learning representations for knowledge graphs and highlight their significance in practical applications. Practical demonstrations will show how to easily learn representation using the PyKEEN library and how to apply it to a real-world NLP problem. 
Jakub Binkowski Representation learning Generative models for graphs    After many advancements in the realm of Graph Representation Learning, graph generation gained much attention due to its vast range of applications (e.g. drug design). Nonetheless, due to the nature of graph data, this task is very difficult and further breakthroughs still need to be discovered. Hence the workshop will provide a ground understanding of the selected methods and problems associated with graph generation. During the workshop, I will show the most important methods in theory and practice. I will show how to implement these methods leveraging Pytorch Geometric library. We will go through training and evaluation using common datasets.
Kamil Kanclerz  NLP, Personalization    Subjective problems in NLP  "A unified gold standard commonly exploited in natural language processing (NLP) tasks requires high inter-annotator agreement. However, there are many subjective problems that should respect users’ individual points of view. At the first glance, disagreement and non-regular annotations can be seen as noise that drags the performance of NLP task detection models down. As we know, the ability to think and perceive the environment differently is natural to humans as such. Therefore, it is crucial to include this observation while building predictive models in order to reflect the setup close to reality. As simple as this may seem, it is important to keep in mind that the key ideas behind NLP phenomenon detection, such as gold standard, agreement coefficients, or the evaluation itself need to be thoroughly analyzed and reconsidered especially for subjective NLP tasks like hate speech detection, prediction of emotional elicitation, sense of humor, sarcasm detection, or even sentiment analysis. Such NLP tasks come with each complexity of their own, especially within the aspect of subjectivity, therefore making them difficult to solve compared to non-subjective tasks.

During the workshop, the participants will be introduced to the novel deep neural architectures leveraging various user representations. Moreover, the user-centered data setups will be explained in comparison to their ground truth equivalents. Additionally, the personalized evaluation techniques will be presented as the methods providing further insight into model ability to understand differences between various user perspectives."
Mateusz Wójcik  MLOps, continual learning   Continual Learning - techniques and applications    "Recently, neural architectures have become effective and widely used in various domains. The parameter optimization process based on gradient descent works well when the data set is sufficiently large and fully available during the training process. But what if we don’t have all the data available during training? What if the number of classes increase? As a result, we have to manually retrain the models from scratch ensuing a time-consuming process.

During this workshop you will learn about the Continual Learning and its applications. We will discuss the catastrophic forgetting and explore various techniques that trying to prevent it starting from simple neural networks up to modern LLMs. As a result, you will understand why we need Continual Learning and how to apply it to existing or new models."
Patryk Wielopolski  Generative Models   Conditional object generation using pre-trained models and plug-in networks Generative models have gained many Machine Learning practitioners’ attention in the last years resulting in models such as StyleGAN for human face generation or PointFlow for the 3D point cloud generation. However, by default, we cannot control its sampling process, i.e., we cannot generate a sample with a specific set of attributes. The current approach is model retraining with additional inputs and different architecture, which requires time and computational resources. During this hands-on workshop we will go through a method which enables to generate objects with a given set of attributes without retraining the base model. For this purpose, we will utilize the normalizing flow models - Conditional Masked Autoregressive Flow and Conditional Real NVP, and plug-in networks resulting in the Flow Plugin Network.
Michał Czuba    Network Science Complex networks part II - spreading processes  Two years ago, the world faced SARS-CoV-2 and the biggest pandemic in the century. Since last winter, with an incursion of Russian troops in Ukraine, all civilised countries have been subjected to misinformation. This year with an election in Poland, a festival of campaign promises has started. The nature of these three examples is complex and hard to analyse. Nonetheless, one of the approaches leading to understanding and controlling such processes is a network simulation. During this workshop, you will learn an essential toolkit to model and analyse spreading phenomena in complex networks. You will understand how to simulate such processes as epidemics or opinion dynamics and how to identify key spreaders of fake news or the most fragile individuals to be vaccinated in the first place.
Mateusz Nurek   Network Science Complex networks part I - social network analysis   Computational network science is a field of artificial intelligence that analyses graphs in applied problems involving social, transportation, epidemiological or energy issues. This workshop will teach you fundamental tools and techniques for analysing this data type. Based on a case study - the history of communication in a particular company, we will solve the problem of optimising the structure of its organisation. We will detect natural teams from employees most intensively working together. We will also identify key personnel, i.e. employees whose loss can cause communication paralysis.
Damian Serwata  Network Science "Complex networks I - social network analysis
Complex networks II - spreading processes"  
Michał Karol    ML w medycynie  Computer Vision for medical image processing    Computer vision has emerged as a revolutionary technology in the medical field, bringing significant transformations in various aspects of healthcare. Its application in clinical practice has paved the way for improved diagnostics, more accurate disease detection, and enhanced treatment planning. The objective of this workshop is to bring comprehensive understanding of the impact of computer vision in clinical practice. Participants will gain insights into how this technology is reshaping healthcare and improving patient outcomes. By exploring the latest advancements in certified medical systems, attendees will learn about the integration of computer vision into existing medical frameworks and protocols. Moreover, the workshop will delve into current research areas within computer vision in medicine. Participants will be introduced to cutting-edge studies and ongoing projects that aim to further enhance the capabilities of computer vision in the healthcare domain. In the second part of the workshop, there will be an interactive session focused on implementing classification and segmentation networks using the JAX framework and the Flax library. 
Piotr Kawa  Analiza dźwięku (TTS, DF)   Generating audio DeepFakes and how to detect them   Recent advances in audio processing and speech synthesis allow the creation of realistic speech - DeepFakes. Despite a number of advantages, this technology poses a threat through its potential applications including disinformation spreading. Participants in this workshop will learn about the latest technologies for speech generation and then how to defend themselves against the malicious use of this technology using state-of-the-art DeepFake detection techniques.



Historia Rozmowy:

Student: jest coś z Large language models?
Asystent:

> Finished chain.
' Tak, mamy kilka warsztatów dotyczących dużych językowych modeli. Zajrzyj do listy warsztatów, aby zobaczyć szczegóły: Łukasz Augustyniak ma warsztat pt. "Duże językowe modele - od demo do produkcji". Kamil Kanclerz ma warsztat pt. „Problem subiektywny w NLP”.'
llm_chain.predict(human_input="Świetnie, jest coś jeszcze innego z NLP?")


> Entering new  chain...
Prompt after formatting:

###

Workshops:
Bartosz Kolasa  MLOps   Systematizing a research code aka introduction to Kedro framework   During the workshops I would like to present the Kedro framework which is a MLOps tool to systematize any data science research project into a pipeline represented by a DAG (directed acyclic graph). Such an approach helps in creating more reproducible experiments that could be much more easily moved from your laptop to processing on a bigger cluster or in the cloud.
Łukasz Augustyniak  Prompt Engineering  Large Language Models - from Demo to Production "In this interactive workshop, we will delve into the fascinating world of large language models and explore their potential in revolutionizing various industries. I will guide participants through the process of transforming cutting-edge demos into scalable production solutions.

Participants will gain hands-on experience by working on practical exercises that demonstrate how to fine-tune these models for specific tasks. Additionally, we'll cover best practices for deploying these models at scale while maintaining efficiency and performance.

Throughout the workshop, attendees can expect engaging discussions about ethical considerations surrounding AI usage as well as insights into future developments within the field. By the end of this session, participants should have a solid understanding of how to harness the power of large language models effectively in order to drive innovation across various domains."
Arkadiusz Janz  Generative Language Models  Training Large Language Models with Reinforcement Learning from Human Feedback (RLHF)   A comprehensive introduction to Generative Language Models and Reinforcement Learning from Human Feedback: a novel approach in training Large Language Models for downstream tasks. This workshop is designed to impart an in-depth understanding of fundamental concepts of Reinforcement Learning (states, actions, rewards, value functions, policies) and Generative Language Models. A theoretical comparison with Supervised Learning paradigm will be discussed, along with the advantages RLHF optimization brings to reducing biases, and overcoming sparse reward issues. Participants will engage in hands-on activities involving RLHF training with simplified models, hyperparameter tuning of RLHF models, and diving into existing RLHF programming frameworks.
Konrad Wojtasik Information Retrieval   Introduction to modern information retrieval    Information retrieval plays a crucial role in modern systems, finding applications across diverse domains and industries. Its relevance spans from web search and recommendation systems to product search and health and legal information retrieval. Information retrieval is not only essential for traditional search applications but also plays a vital role in retrieval-augmented Question Answering systems. Additionally, it serves as a valuable mechanism to prevent Large Language Models from generating incorrect or hallucinated information. Moreover, it ensures that their knowledge remains accurate and up-to-date. During this workshop, participants will have the opportunity to explore and understand current state-of-the-art models used in information retrieval. They will gain insights into the strengths and limitations of these models. Furthermore, the workshop will focus on setting up an information retrieval pipeline, allowing participants to gain hands-on experience in building and implementing such systems. Additionally, participants will learn how to effectively measure and evaluate the performance of their information retrieval pipelines.
Mateusz Gniewkowski XAI Model Agnostic Explanations Techniques  "Machine learning models can often be complex and difficult to understand, therefore it is important to be able to explain how these models work, as they are increasingly used in a wide range of industries and applications.
The workshop will start by discussing some basic ways to explain machine learning models, such as using feature importance measures, decision trees, and visualization tools. However, the focus will then shift to model-agnostic techniques, which can be applied to any type of machine learning model.
The techniques that will be covered in the workshop include LIME (Local Interpretable Model-Agnostic Explanations) and SHAP (SHapley Additive exPlanations). These libraries are designed to provide more transparent and understandable explanations for machine learning models, even when the models themselves are complex or difficult to interpret."
Piotr Bielak    Representation learning Introduction to graph representation learning   In recent years, representation learning has attracted much attention both in the research community and industrial applications. Learning representations for graphs is especially challenging due to the relational nature of such data, i.e., one must reflect both the rich attribute space and graph structure in the embedding vectors. During this workshop, I will show how to use the PyTorch-Geometric library to easily build graph representations and solve a variety of applications. We will explore node, edge and graph-level representations through the prism of their associated downstream tasks and corresponding deep learning models (Graph Neural Networks).
Denis Janiak    Representation learning, Bayesian methods   Does Representation Know What It Doesn't Know?  "Uncertainty estimation is a critical aspect of artificial intelligence systems, enabling them to quantify their confidence and provide reliable predictions. However, accurately assessing uncertainty becomes increasingly challenging when AI models encounter scenarios outside their training data distribution. This workshop, titled ""Does Representation Know What It Doesn't Know?,"" aims to explore the concept of uncertainty estimation in AI systems and delve into the question of whether representations within these systems possess the ability to recognize their own limitations. During the workshop, we will investigate the various techniques and methodologies employed in uncertainty estimation, such as Bayesian approaches and deep learning-based techniques. We will analyze the strengths and limitations of these approaches and discuss their implications for real-world applications.
Furthermore, the workshop will delve into the concept of representation learning and its impact on uncertainty estimation. We will examine whether AI systems can effectively recognize when they are faced with novel or out-of-distribution inputs. Additionally, we will explore approaches to measure and improve representation awareness, enabling models to identify areas of uncertainty and seek further guidance or human intervention when necessary.
By the end of the workshop, attendees will gain a deeper understanding of the state-of-the-art techniques for uncertainty estimation and its importance in building robust AI systems. They will also gain insights into the fundamental question of whether representations within AI models possess the capability to identify areas of uncertainty and adapt accordingly. "
Albert Sawczyn  Representation learning Knowledge Graph Representation Learning Knowledge graphs have emerged as powerful tools for organizing and representing structured information in various domains, enabling efficient data integration, inference, and knowledge discovery. Knowledge graph representation learning aims to capture the rich semantic relationships and contextual information within knowledge graphs, facilitating effective knowledge inference and reasoning. This workshop aims to introduce the fundamental challenge of learning representations for knowledge graphs and highlight their significance in practical applications. Practical demonstrations will show how to easily learn representation using the PyKEEN library and how to apply it to a real-world NLP problem. 
Jakub Binkowski Representation learning Generative models for graphs    After many advancements in the realm of Graph Representation Learning, graph generation gained much attention due to its vast range of applications (e.g. drug design). Nonetheless, due to the nature of graph data, this task is very difficult and further breakthroughs still need to be discovered. Hence the workshop will provide a ground understanding of the selected methods and problems associated with graph generation. During the workshop, I will show the most important methods in theory and practice. I will show how to implement these methods leveraging Pytorch Geometric library. We will go through training and evaluation using common datasets.
Kamil Kanclerz  NLP, Personalization    Subjective problems in NLP  "A unified gold standard commonly exploited in natural language processing (NLP) tasks requires high inter-annotator agreement. However, there are many subjective problems that should respect users’ individual points of view. At the first glance, disagreement and non-regular annotations can be seen as noise that drags the performance of NLP task detection models down. As we know, the ability to think and perceive the environment differently is natural to humans as such. Therefore, it is crucial to include this observation while building predictive models in order to reflect the setup close to reality. As simple as this may seem, it is important to keep in mind that the key ideas behind NLP phenomenon detection, such as gold standard, agreement coefficients, or the evaluation itself need to be thoroughly analyzed and reconsidered especially for subjective NLP tasks like hate speech detection, prediction of emotional elicitation, sense of humor, sarcasm detection, or even sentiment analysis. Such NLP tasks come with each complexity of their own, especially within the aspect of subjectivity, therefore making them difficult to solve compared to non-subjective tasks.

During the workshop, the participants will be introduced to the novel deep neural architectures leveraging various user representations. Moreover, the user-centered data setups will be explained in comparison to their ground truth equivalents. Additionally, the personalized evaluation techniques will be presented as the methods providing further insight into model ability to understand differences between various user perspectives."
Mateusz Wójcik  MLOps, continual learning   Continual Learning - techniques and applications    "Recently, neural architectures have become effective and widely used in various domains. The parameter optimization process based on gradient descent works well when the data set is sufficiently large and fully available during the training process. But what if we don’t have all the data available during training? What if the number of classes increase? As a result, we have to manually retrain the models from scratch ensuing a time-consuming process.

During this workshop you will learn about the Continual Learning and its applications. We will discuss the catastrophic forgetting and explore various techniques that trying to prevent it starting from simple neural networks up to modern LLMs. As a result, you will understand why we need Continual Learning and how to apply it to existing or new models."
Patryk Wielopolski  Generative Models   Conditional object generation using pre-trained models and plug-in networks Generative models have gained many Machine Learning practitioners’ attention in the last years resulting in models such as StyleGAN for human face generation or PointFlow for the 3D point cloud generation. However, by default, we cannot control its sampling process, i.e., we cannot generate a sample with a specific set of attributes. The current approach is model retraining with additional inputs and different architecture, which requires time and computational resources. During this hands-on workshop we will go through a method which enables to generate objects with a given set of attributes without retraining the base model. For this purpose, we will utilize the normalizing flow models - Conditional Masked Autoregressive Flow and Conditional Real NVP, and plug-in networks resulting in the Flow Plugin Network.
Michał Czuba    Network Science Complex networks part II - spreading processes  Two years ago, the world faced SARS-CoV-2 and the biggest pandemic in the century. Since last winter, with an incursion of Russian troops in Ukraine, all civilised countries have been subjected to misinformation. This year with an election in Poland, a festival of campaign promises has started. The nature of these three examples is complex and hard to analyse. Nonetheless, one of the approaches leading to understanding and controlling such processes is a network simulation. During this workshop, you will learn an essential toolkit to model and analyse spreading phenomena in complex networks. You will understand how to simulate such processes as epidemics or opinion dynamics and how to identify key spreaders of fake news or the most fragile individuals to be vaccinated in the first place.
Mateusz Nurek   Network Science Complex networks part I - social network analysis   Computational network science is a field of artificial intelligence that analyses graphs in applied problems involving social, transportation, epidemiological or energy issues. This workshop will teach you fundamental tools and techniques for analysing this data type. Based on a case study - the history of communication in a particular company, we will solve the problem of optimising the structure of its organisation. We will detect natural teams from employees most intensively working together. We will also identify key personnel, i.e. employees whose loss can cause communication paralysis.
Damian Serwata  Network Science "Complex networks I - social network analysis
Complex networks II - spreading processes"  
Michał Karol    ML w medycynie  Computer Vision for medical image processing    Computer vision has emerged as a revolutionary technology in the medical field, bringing significant transformations in various aspects of healthcare. Its application in clinical practice has paved the way for improved diagnostics, more accurate disease detection, and enhanced treatment planning. The objective of this workshop is to bring comprehensive understanding of the impact of computer vision in clinical practice. Participants will gain insights into how this technology is reshaping healthcare and improving patient outcomes. By exploring the latest advancements in certified medical systems, attendees will learn about the integration of computer vision into existing medical frameworks and protocols. Moreover, the workshop will delve into current research areas within computer vision in medicine. Participants will be introduced to cutting-edge studies and ongoing projects that aim to further enhance the capabilities of computer vision in the healthcare domain. In the second part of the workshop, there will be an interactive session focused on implementing classification and segmentation networks using the JAX framework and the Flax library. 
Piotr Kawa  Analiza dźwięku (TTS, DF)   Generating audio DeepFakes and how to detect them   Recent advances in audio processing and speech synthesis allow the creation of realistic speech - DeepFakes. Despite a number of advantages, this technology poses a threat through its potential applications including disinformation spreading. Participants in this workshop will learn about the latest technologies for speech generation and then how to defend themselves against the malicious use of this technology using state-of-the-art DeepFake detection techniques.



Historia Rozmowy:
Human: jest coś z Large language models?
AI:  Tak, mamy kilka warsztatów dotyczących dużych językowych modeli. Zajrzyj do listy warsztatów, aby zobaczyć szczegóły: Łukasz Augustyniak ma warsztat pt. "Duże językowe modele - od demo do produkcji". Kamil Kanclerz ma warsztat pt. „Problem subiektywny w NLP”.
Student: Świetnie, jest coś jeszcze innego z NLP?
Asystent:

> Finished chain.
' Tak, mamy kilka warsztatów związanych z NLP. Piotr Bielak ma warsztat pt. „Wprowadzenie do nowoczesnego wyszukiwania informacji”, a Denis Janiak ma warsztat pt. „Czy reprezentacja wie, czego nie wie? ".'