├── .gitattributes ├── README.md ├── materials └── pycharm-documentation.pdf ├── notebooks └── rag-pdf-qa.ipynb ├── requirements.txt └── talk-materials ├── beyond-the-hype.pdf └── talk-sources.md /.gitattributes: -------------------------------------------------------------------------------- 1 | .pdf filter=lfs diff=lfs merge=lfs -text 2 | materials/pycharm-documentation.pdf filter=lfs diff=lfs merge=lfs -text 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Beyond the Hype: A Realistic Look at Large Language Models 2 | 3 | The following repo contains the materials for my talk delivered at GOTO Amsterdam 2024. 4 | 5 | The repo contains the following: 6 | * `/notebooks/rag-pdf-qa.ipynb` contains the code for the simple RAG pipeline I demoed during the talk. There are extensive notes in Markdown in this notebook to help you understand how to adapt this for your own use case. 7 | * `talk-materials/talk-sources.md` contains all of the papers and other sources I used for this talk. It also contains all of my image credits. 8 | * `talk-materials/beyond-the-hype.pdf` contains a copy of my slides. -------------------------------------------------------------------------------- /materials/pycharm-documentation.pdf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:537960b38c47735893969f56c742be5cc7279cf858c3163af3c76d4f353c4ca0 3 | size 174047752 4 | -------------------------------------------------------------------------------- /notebooks/rag-pdf-qa.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "metadata": {}, 5 | "cell_type": "markdown", 6 | "source": [ 7 | "# Simple RAG pipeline allowing you to \"talk\" to your documentation\n", 8 | "\n", 9 | "This notebook contains a simple application for using retrieval augmented generation (RAG) to \"ask questions\" from a PDF, using a powerful package called `langchain`. In this case, we're going to use a PDF of the PyCharm documentation, but `langchain` allows you to use a [wide variety of input formats](https://python.langchain.com/v0.1/docs/modules/data_connection/document_loaders/), giving you significant flexibility over your input data source.\n", 10 | "\n", 11 | "In this pipeline, we'll need to do the following:\n", 12 | "* Load in (for local models) or connect to the API of (for remote models) our LLM;\n", 13 | "* Load in our PDF that we want to \"chat\" to;\n", 14 | "* We can't pass the whole PDF into a model at the same time (it's almost 2000 pages!). As such, we need to split it into chunks;\n", 15 | "* Rather than needing to pass every individual chunk through the LLM to find the information in the document relevant to a question, we can convert these chunks into document embeddings, which we then store in a vector database. At query time, the question is also converted into a document embedding, and the most similar document chunks to the question are retrieved." 16 | ], 17 | "id": "19e695dc29bb9a3a" 18 | }, 19 | { 20 | "metadata": { 21 | "ExecuteTime": { 22 | "end_time": "2024-12-06T11:45:06.805519Z", 23 | "start_time": "2024-12-06T11:45:04.741903Z" 24 | } 25 | }, 26 | "cell_type": "code", 27 | "source": [ 28 | "from dotenv import load_dotenv\n", 29 | "\n", 30 | "from langchain import chains, vectorstores\n", 31 | "from langchain_community.document_loaders import PyPDFLoader\n", 32 | "from langchain.text_splitter import CharacterTextSplitter\n", 33 | "from langchain_openai import ChatOpenAI, OpenAIEmbeddings\n", 34 | "from langchain_chroma import Chroma\n", 35 | "\n", 36 | "import re\n", 37 | "import PyPDF2" 38 | ], 39 | "id": "a98011df002e3ac7", 40 | "outputs": [], 41 | "execution_count": 1 42 | }, 43 | { 44 | "metadata": {}, 45 | "cell_type": "markdown", 46 | "source": [ 47 | "## Count the number of pages in the PDF\n", 48 | "\n", 49 | "As you can see, we have a lot of documentation to sort through here!" 50 | ], 51 | "id": "ac5853364f53f165" 52 | }, 53 | { 54 | "metadata": { 55 | "ExecuteTime": { 56 | "end_time": "2024-12-06T11:45:40.679685Z", 57 | "start_time": "2024-12-06T11:45:40.430619Z" 58 | } 59 | }, 60 | "cell_type": "code", 61 | "source": [ 62 | "pdf = PyPDF2.PdfReader(open(\"../materials/pycharm-documentation.pdf\", \"rb\"))\n", 63 | "len(pdf.pages)" 64 | ], 65 | "id": "1ad45b37d3f23ea5", 66 | "outputs": [ 67 | { 68 | "data": { 69 | "text/plain": [ 70 | "1924" 71 | ] 72 | }, 73 | "execution_count": 2, 74 | "metadata": {}, 75 | "output_type": "execute_result" 76 | } 77 | ], 78 | "execution_count": 2 79 | }, 80 | { 81 | "metadata": { 82 | "ExecuteTime": { 83 | "end_time": "2024-12-06T11:45:41.994376Z", 84 | "start_time": "2024-12-06T11:45:41.988630Z" 85 | } 86 | }, 87 | "cell_type": "code", 88 | "source": [ 89 | "class PdfQA:\n", 90 | " \"\"\"\n", 91 | " Initializes the PdfQA class with the specified parameters.\n", 92 | "\n", 93 | " :param model: The name or path of the model to be loaded.\n", 94 | " :param pdf_document: The path to the PDF document to be loaded.\n", 95 | " :param chunk_size: The desired size of each chunk.\n", 96 | " :param chunk_overlap: The specified overlap between chunks.\n", 97 | " :param search_type: The type of search to be performed.\n", 98 | " :param n_documents: The number of documents to be retrieved.\n", 99 | " :param chain_type: The type of chain to create.\n", 100 | " \"\"\"\n", 101 | "\n", 102 | " def __init__(self, model, pdf_document, chunk_size, chunk_overlap,\n", 103 | " search_type, n_documents, chain_type):\n", 104 | " load_dotenv()\n", 105 | " self.init_chat_model(model)\n", 106 | " self.load_documents(pdf_document)\n", 107 | " self.split_documents(chunk_size, chunk_overlap)\n", 108 | " self.select_embedding = OpenAIEmbeddings()\n", 109 | " self.create_vectorstore()\n", 110 | " self.create_retriever(search_type, n_documents)\n", 111 | " self.chain = self.create_chain(chain_type)\n", 112 | "\n", 113 | " def init_chat_model(self, model):\n", 114 | " \"\"\"\n", 115 | " Initialize the chat model.\n", 116 | "\n", 117 | " :param model: The name or path of the model to be loaded.\n", 118 | " :return: None\n", 119 | "\n", 120 | " \"\"\"\n", 121 | " print(\"Loading model\")\n", 122 | " self.llm = ChatOpenAI(model_name=model, temperature=0)\n", 123 | "\n", 124 | " def load_documents(self, pdf_document):\n", 125 | " \"\"\"\n", 126 | " Load documents from a PDF file and convert to a format that can be ingested by the langchain\n", 127 | " document splitter.\n", 128 | "\n", 129 | " :param pdf_document: The path to the PDF document to be loaded.\n", 130 | " :return: None\n", 131 | " \"\"\"\n", 132 | " print(\"Loading PDFs\")\n", 133 | " pdf_loader = PyPDFLoader(pdf_document)\n", 134 | " self.documents = pdf_loader.load()\n", 135 | "\n", 136 | " def split_documents(self, chunk_size, chunk_overlap):\n", 137 | " \"\"\"\n", 138 | " Split the documents into chunks of a given size with a specified overlap.\n", 139 | "\n", 140 | " :param chunk_size: The desired size of each chunk.\n", 141 | " :type chunk_size: int\n", 142 | " :param chunk_overlap: The specified overlap between chunks.\n", 143 | " :type chunk_overlap: int\n", 144 | " :return: None\n", 145 | " \"\"\"\n", 146 | " print(\"Splitting documents\")\n", 147 | " text_splitter = CharacterTextSplitter(chunk_size=chunk_size, chunk_overlap=chunk_overlap)\n", 148 | " self.texts = text_splitter.split_documents(self.documents)\n", 149 | "\n", 150 | " def create_vectorstore(self):\n", 151 | " \"\"\"\n", 152 | " Create Vector Store.\n", 153 | "\n", 154 | " This method creates document embeddings using the Chroma algorithm from the given texts and selected embedding.\n", 155 | "\n", 156 | " :return: None\n", 157 | " \"\"\"\n", 158 | " print(\"Creating document embeddings\")\n", 159 | " self.db = Chroma.from_documents(self.texts, self.select_embedding)\n", 160 | "\n", 161 | " def create_retriever(self, search_type, n_documents):\n", 162 | " \"\"\"\n", 163 | " Generate a chunk retriever for the given search type and number of documents.\n", 164 | "\n", 165 | " :param search_type: The type of search to be performed.\n", 166 | " :param n_documents: The number of documents to be retrieved.\n", 167 | " :return: None\n", 168 | " \"\"\"\n", 169 | " print(\"Generating chunk retriever\")\n", 170 | " self.retriever = self.db.as_retriever(search_type=search_type, search_kwargs={\"k\": n_documents})\n", 171 | "\n", 172 | " def create_chain(self, chain_type):\n", 173 | " \"\"\"\n", 174 | " :param chain_type: The type of chain to create.\n", 175 | " :return: The created chain.\n", 176 | " \"\"\"\n", 177 | " qa = chains.RetrievalQA.from_chain_type(llm=self.llm,\n", 178 | " chain_type=chain_type,\n", 179 | " retriever=self.retriever,\n", 180 | " return_source_documents=True)\n", 181 | " return qa\n", 182 | "\n", 183 | " def query_chain(self):\n", 184 | " \"\"\"\n", 185 | " Returns the chain of the object.\n", 186 | "\n", 187 | " :return: The chain of the object.\n", 188 | " \"\"\"\n", 189 | " return self.chain" 190 | ], 191 | "id": "a6c1a3bcaaee5c40", 192 | "outputs": [], 193 | "execution_count": 3 194 | }, 195 | { 196 | "metadata": {}, 197 | "cell_type": "markdown", 198 | "source": [ 199 | "## Levers in the RAG pipeline\n", 200 | "RAG is quite tricky to get right, especially if you need it to be efficient. There are many levers we can pull in our pipeline, which influence the following things:\n", 201 | "* How fast we can get our answers;\n", 202 | "* How relevant our answers are (and related, how likely we are to get a hallucination);\n", 203 | "* How complete our answers are.\n", 204 | "\n", 205 | "Let's instantiate our PDF questioner with the following values:\n", 206 | "* `model`: the LLM used to generate answers using information from the document. In this case, `gpt-3.5-turbo`.\n", 207 | "* `pdf_document`: the PDF we want to \"chat with\". In our case, we've selected our PDF containing almost all of the PyCharm documentation.\n", 208 | "* `chunk_size`: the maximum number of tokens to include in each chunk. We've selected 1000.\n", 209 | "* `chunk_overlap`: the number of tokens that should overlap between adjacent chunks. We've selected 0, so no overlapping tokens.\n", 210 | "* `search_type`: the metric by which chunks are selected. In this case, we've selected \"similarity\", so those chunks with the highest (cosine) similarity to the content of the question we're asking. However, you can also use \"mmr\" (if supported by your document store) which tries to maximise for relevancy and diversity of results.\n", 211 | "* `n_documents`: the maximum number of chunks to use to generate the answer. In this case, we've used 5.\n", 212 | "* `chain_type`: this controls how the content is passed into the LLM. In the case of \"stuff\" it passes all gathered context chunks into the context window at once. Other options are \"refine\", which feeds in the chunks in batches, plus the answer generated so far, and \"map-rerank\", which feeds in each chunk and assigns a score based on how well it answered the question.\n", 213 | "\n", 214 | "Other levers I've chosen not to make arguments in this class are the model used for embeddings (the `OpenAIEmbeddings` were used) and which vector database we use to store the document embeddings (in this case, the `Chroma` vector store was used)." 215 | ], 216 | "id": "337a752314ad724" 217 | }, 218 | { 219 | "metadata": { 220 | "ExecuteTime": { 221 | "end_time": "2024-12-06T11:35:12.839701Z", 222 | "start_time": "2024-12-06T11:35:12.836663Z" 223 | } 224 | }, 225 | "cell_type": "code", 226 | "source": "load_dotenv()", 227 | "id": "d289d321d47cd47f", 228 | "outputs": [ 229 | { 230 | "data": { 231 | "text/plain": [ 232 | "False" 233 | ] 234 | }, 235 | "execution_count": 5, 236 | "metadata": {}, 237 | "output_type": "execute_result" 238 | } 239 | ], 240 | "execution_count": 5 241 | }, 242 | { 243 | "metadata": { 244 | "ExecuteTime": { 245 | "end_time": "2024-12-06T11:46:19.300978Z", 246 | "start_time": "2024-12-06T11:45:46.942267Z" 247 | } 248 | }, 249 | "cell_type": "code", 250 | "source": [ 251 | "pdf_qa = PdfQA(\"gpt-3.5-turbo\", \"../materials/pycharm-documentation.pdf\", 1000, 0, \"similarity\", \n", 252 | " 5, \"stuff\")\n", 253 | "pdf_qa_chain = pdf_qa.query_chain()" 254 | ], 255 | "id": "696e06baa6306eeb", 256 | "outputs": [ 257 | { 258 | "name": "stdout", 259 | "output_type": "stream", 260 | "text": [ 261 | "Loading model\n", 262 | "Loading PDFs\n", 263 | "Splitting documents\n", 264 | "Creating document embeddings\n", 265 | "Generating chunk retriever\n" 266 | ] 267 | } 268 | ], 269 | "execution_count": 4 270 | }, 271 | { 272 | "metadata": {}, 273 | "cell_type": "markdown", 274 | "source": "Let's try it out by asking how we can debug in PyCharm.", 275 | "id": "e1618a7539d451a0" 276 | }, 277 | { 278 | "metadata": { 279 | "ExecuteTime": { 280 | "end_time": "2024-12-06T11:46:33.578117Z", 281 | "start_time": "2024-12-06T11:46:31.349948Z" 282 | } 283 | }, 284 | "cell_type": "code", 285 | "source": "answer1 = pdf_qa_chain.invoke({\"query\": \"What are the options for debugging with PyCharm?\"})", 286 | "id": "ec7e8f62e1ff0803", 287 | "outputs": [], 288 | "execution_count": 5 289 | }, 290 | { 291 | "metadata": { 292 | "ExecuteTime": { 293 | "end_time": "2024-12-06T11:46:35.143288Z", 294 | "start_time": "2024-12-06T11:46:35.140068Z" 295 | } 296 | }, 297 | "cell_type": "code", 298 | "source": "answer1[\"result\"]", 299 | "id": "6d1fbc81d231df98", 300 | "outputs": [ 301 | { 302 | "data": { 303 | "text/plain": [ 304 | "'The options for debugging with PyCharm include placing breakpoints at specific lines of code where program execution will be suspended, stepping through the code line by line, evaluating expressions, adding watches, and manually setting variable values. You can start debugging by pressing a specific key, and then navigate through the program execution using the available options in the Run menu or the Debug tool window. Additionally, PyCharm provides a Debug tool window with dedicated panes for frames, variables, watches, and a Console tab for input and output information.'" 305 | ] 306 | }, 307 | "execution_count": 6, 308 | "metadata": {}, 309 | "output_type": "execute_result" 310 | } 311 | ], 312 | "execution_count": 6 313 | }, 314 | { 315 | "metadata": {}, 316 | "cell_type": "markdown", 317 | "source": "We can see the answer is very comprehensive. Let's have a look at the information it was based on from the documentation.", 318 | "id": "2d0f4f9b2ba9b26" 319 | }, 320 | { 321 | "metadata": { 322 | "ExecuteTime": { 323 | "end_time": "2024-12-06T11:46:40.067281Z", 324 | "start_time": "2024-12-06T11:46:40.065048Z" 325 | } 326 | }, 327 | "cell_type": "code", 328 | "source": [ 329 | "for document in answer1[\"source_documents\"]:\n", 330 | " index_n = answer1[\"source_documents\"].index(document)\n", 331 | " print(f\"\\nDOCUMENT {index_n + 1}\")\n", 332 | " print(re.sub(r\"\\s+\", \" \", document.page_content.strip()))" 333 | ], 334 | "id": "f1453f0dff1fe05d", 335 | "outputs": [ 336 | { 337 | "name": "stdout", 338 | "output_type": "stream", 339 | "text": [ 340 | "\n", 341 | "DOCUMENT 1\n", 342 | "Debug Does your application stumble on a runtime error? To find out what’s causing it, you will have to do some debugging. PyCharm supports the debugger on all platforms. Debugging starts with placing breakpoints at which program execution will be suspended, so you can explore program data. Just click the gutter of the line where you want the breakpoint to appear. To start debugging your application, press . Then go through the program execution step by step (see the available options in the Run menu or the Debug tool window), evaluate any arbitrary expression, add watches, and manually set values for the variables. For more information, refer to Debugging. Test It is a good idea to test your applications, and PyCharm helps doing it as simple as possible. With PyCharm, you can: ⌃Ctrl D Create tests• Create special testing run/debug configurations.• Run and debug tests right from the IDE, using the testing run/debug configurations.•\n", 343 | "\n", 344 | "DOCUMENT 2\n", 345 | "For more information, refer to Breakpoints. Starting the debugger session OK now, as we've added breakpoints, everything is ready for debugging. PyCharm allows starting the debugger session in several ways. Let's choose one: click in the gutter, and then select the command Debug 'solver' in the popup menu that opens:\n", 346 | "\n", 347 | "DOCUMENT 3\n", 348 | "Launch it and observe results in the Test Runner tab of the Run tool window. To see successful test along with the failed ones, click Show Passed on the toolbar. Debug run First of all, why do we need debugging? Suppose, you hit a runtime error. Sometimes the reason of the error is clear. But in more complex case you may need to investigate and inspect the state of your program at different points in its execution. This is where debugging is necessary. With PyCharm, you can debug your applications without leaving the IDE. The only thing you need to do beforehand is to place breakpoints in the required places. Let's explore\n", 349 | "\n", 350 | "DOCUMENT 4\n", 351 | "Debugging in detail The Debug tool window consists of dedicated panes for frames, variables, and watches, as well as the Console tab, where all the input and output information is displayed. If you want the console to be always visible, you can drag it to one of the PyCharm window's edges. Stepping If you want to see what your code does line by line, there's no need to put a breakpoint on every line, you can step through your code. Let's see what it looks like to step through our example program. Start or restart the debugger by using the Run widget at the top of the window:\n", 352 | "\n", 353 | "DOCUMENT 5\n", 354 | "Python support in PyCharm PyCharm provides the following features to help you work with Python: Feature PyCharm Community PyCharm Professional Dedicated project types Ability to configure local interpreters and virtual environments. Ability to configure remote and docker-based interpreters. Python console. Run/debug configurations for Python Run/debug configurations for Python remote debug Code insight, Code inspections, Intention actions, and Code completion Built-in code formatter and separate set of Python code style settings Limited to Python, HTML, JSON, XML, and YAML Find usages in Python code.\n" 355 | ] 356 | } 357 | ], 358 | "execution_count": 7 359 | }, 360 | { 361 | "metadata": {}, 362 | "cell_type": "markdown", 363 | "source": [ 364 | "We can see that the first three chunks are the most relevant, while the last three don't really add that much to the answer.\n", 365 | "\n", 366 | "If we'd like, we can go a bit deeper with our answer. We can set up a memory for the last answer the LLM gave us so we can ask follow up questions. In this case, let's see if the LLM left out anything about PyCharm's debugging." 367 | ], 368 | "id": "988b16f0387ce399" 369 | }, 370 | { 371 | "metadata": { 372 | "ExecuteTime": { 373 | "end_time": "2024-12-06T11:46:44.813876Z", 374 | "start_time": "2024-12-06T11:46:43.887673Z" 375 | } 376 | }, 377 | "cell_type": "code", 378 | "source": [ 379 | "chat_history1 = [(answer1[\"query\"], answer1[\"result\"])]\n", 380 | "answer2 = pdf_qa_chain.invoke({\"query\": \"Have you left out any other types of debugging?\",\n", 381 | " \"chat_history\": chat_history1})" 382 | ], 383 | "id": "233bb88309ba48d7", 384 | "outputs": [], 385 | "execution_count": 8 386 | }, 387 | { 388 | "metadata": { 389 | "ExecuteTime": { 390 | "end_time": "2024-12-06T11:46:46.406735Z", 391 | "start_time": "2024-12-06T11:46:46.404038Z" 392 | } 393 | }, 394 | "cell_type": "code", 395 | "source": "answer2[\"result\"]", 396 | "id": "3d5d632b16484d7a", 397 | "outputs": [ 398 | { 399 | "data": { 400 | "text/plain": [ 401 | "'Yes, the provided context does not mention any other types of debugging besides stepping through the code, working with variables, and using the console for input and output information.'" 402 | ] 403 | }, 404 | "execution_count": 9, 405 | "metadata": {}, 406 | "output_type": "execute_result" 407 | } 408 | ], 409 | "execution_count": 9 410 | }, 411 | { 412 | "metadata": {}, 413 | "cell_type": "markdown", 414 | "source": "If our model is capable of it, we can even enter queries in a different language to the source documentation, and get relevant answers back in this language. Here we question our English-language documentation in German ...", 415 | "id": "c6922b4d1d9ba8fa" 416 | }, 417 | { 418 | "metadata": { 419 | "ExecuteTime": { 420 | "end_time": "2024-12-06T11:46:59.444462Z", 421 | "start_time": "2024-12-06T11:46:56.765511Z" 422 | } 423 | }, 424 | "cell_type": "code", 425 | "source": "answer3 = pdf_qa_chain.invoke({\"query\": \"Wie kann man PyCharm installieren?\"})", 426 | "id": "977361cabc240a1a", 427 | "outputs": [], 428 | "execution_count": 10 429 | }, 430 | { 431 | "metadata": {}, 432 | "cell_type": "markdown", 433 | "source": "... and get a relevant answer in German!", 434 | "id": "775a8861805a7351" 435 | }, 436 | { 437 | "metadata": { 438 | "ExecuteTime": { 439 | "end_time": "2024-12-06T11:47:00.951035Z", 440 | "start_time": "2024-12-06T11:47:00.948824Z" 441 | } 442 | }, 443 | "cell_type": "code", 444 | "source": [ 445 | "for document in answer3[\"source_documents\"]:\n", 446 | " index_n = answer3[\"source_documents\"].index(document)\n", 447 | " print(f\"\\nDOCUMENT {index_n + 1}\")\n", 448 | " print(re.sub(r\"\\s+\", \" \", document.page_content.strip()))" 449 | ], 450 | "id": "7bc9df603729ace6", 451 | "outputs": [ 452 | { 453 | "name": "stdout", 454 | "output_type": "stream", 455 | "text": [ 456 | "\n", 457 | "DOCUMENT 1\n", 458 | "PyCharm 2024.1 Getting started/Installation guide Last modified: 06 May 2024 PyCharm is a cross-platform IDE that provides consistent experience on the Windows, macOS, and Linux operating systems. PyCharm is available in two editions: Professional, and Community. The Community edition is an open-source project, and it's free, but it has fewer features. The Professional edition is commercial, and provides an outstanding set of tools and features. For more information, refer to the editions comparison matrix↗ . Install PyCharm\n", 459 | "\n", 460 | "DOCUMENT 2\n", 461 | "To run PyCharm, find it in the Windows Start menu or use the desktop shortcut. You can also run the launcher batch script or executable in the installation directory under bin. When you run PyCharm for the first time, you can take several steps to complete the installation, customize your instance, and start working with the IDE. For more information, refer to Run PyCharm for the first time. For more information about the location of the default IDE directories with user- specific files, refer to Directories used by the IDE. Silent installation on Windows Silent installation is performed without any user interface. It can be used by network administrators to install PyCharm on a number of machines and avoid interrupting other users. To perform silent install, run the installer with the following switches: There is a separate installer for ARM64 processors. To verify the integrity of the installer, use the SHA checksum linked from the Download↗ page. Run the installer and follow the wizard steps. Mind the following options in the installation wizard 2. 64-bit launcher: Adds a launching icon to the Desktop.• Open Folder as Project: Adds an option to the folder context menu that will allow opening the selected directory as a PyCharm project. • .py: Establishes an association with Python files to open them in PyCharm.• Add launchers dir to the PATH: Allows running this PyCharm instance from the Console without specifying the path to it. •\n", 462 | "\n", 463 | "DOCUMENT 3\n", 464 | "You can install PyCharm using Toolbox or standalone installations. If you need assistance installing PyCharm, see the installation instructions: Install PyCharm Requirement Minimum Recommended Operating system Officially released versions of the following: Pre-release versions are not supported. The latest versions of the following: Microsoft Windows 10 1809 64-bit or later Windows Server 2019 64- bit or later • macOS 12.0 or later• Ubuntu Linux 20.04 LTS or a later LTS version that uses the following: • Gnome or KDE• X Window System (X11) Wayland support is in development. You can monitor the progress and leave your feedback in JBR-3206: Native Wayland support↗ . • GLIBC↗ 2.29 or later• Windows 64-bit• macOS• Ubuntu Linux LTS•\n", 465 | "\n", 466 | "DOCUMENT 4\n", 467 | "Log in to your JetBrains Account from the Toolbox App, and it will automatically activate the available licenses for any IDE that you install. If you installed PyCharm via the Toolbox App↗ , you can find the installation directory in the app: open the settings of the IDE instance in the Toolbox App, expand Configuration, and look for the Install location field. Standalone installation Install PyCharm manually to manage the location of every instance and all the configuration files. For example, if you have a policy that requires specific install locations. macOS Linux Download the installer↗ .exe.1. Windows\n", 468 | "\n", 469 | "DOCUMENT 5\n", 470 | "PyCharm 2024.1 Getting started/Installation guide/Run PyCharm for the first time Last modified: 15 May 2024 You can use the Toolbox App to run any JetBrains product. In the case of a standalone installation, running PyCharm depends on the operating system: To run PyCharm, find it in the Windows Start menu or use the desktop shortcut. You can also run the launcher batch script or executable in the installation directory under bin. For more information about running PyCharm from the command line, refer to Command-line interface. You will see the Welcome screen, the starting point to your work with the IDE. This screen also appears when you close all opened projects. Use the tabs on the left side to switch to the specific welcome dialog. Run PyCharm for the first time macOS LinuxWindows\n" 471 | ] 472 | } 473 | ], 474 | "execution_count": 11 475 | }, 476 | { 477 | "metadata": { 478 | "ExecuteTime": { 479 | "end_time": "2024-12-06T11:47:07.926430Z", 480 | "start_time": "2024-12-06T11:47:07.924180Z" 481 | } 482 | }, 483 | "cell_type": "code", 484 | "source": "answer3[\"result\"]", 485 | "id": "24653b6650739585", 486 | "outputs": [ 487 | { 488 | "data": { 489 | "text/plain": [ 490 | "'Um PyCharm zu installieren, gibt es mehrere Möglichkeiten:\\n\\n1. **Verwendung des Toolbox-Apps**: Wenn du das Toolbox-App verwendest, kannst du PyCharm darüber installieren. Logge dich in deinem JetBrains-Konto ein und das Toolbox-App wird automatisch verfügbare Lizenzen aktivieren.\\n\\n2. **Standalone-Installation**: Du kannst PyCharm auch manuell installieren, um den Speicherort jeder Instanz und aller Konfigurationsdateien zu verwalten. Dies ist nützlich, wenn du spezifische Installationsorte benötigst.\\n\\n3. **Stille Installation auf Windows**: Wenn du eine stille Installation ohne Benutzeroberfläche durchführen möchtest, kannst du den Installer mit bestimmten Schaltern ausführen. Dies ist nützlich für Netzwerkadministratoren, um PyCharm auf mehreren Maschinen zu installieren, ohne andere Benutzer zu unterbrechen.\\n\\nJe nachdem, welche Methode du bevorzugst, kannst du PyCharm entweder über das Toolbox-App installieren oder die Standalone-Installation durchführen.'" 491 | ] 492 | }, 493 | "execution_count": 12, 494 | "metadata": {}, 495 | "output_type": "execute_result" 496 | } 497 | ], 498 | "execution_count": 12 499 | } 500 | ], 501 | "metadata": { 502 | "kernelspec": { 503 | "display_name": "Python 3", 504 | "language": "python", 505 | "name": "python3" 506 | }, 507 | "language_info": { 508 | "codemirror_mode": { 509 | "name": "ipython", 510 | "version": 2 511 | }, 512 | "file_extension": ".py", 513 | "mimetype": "text/x-python", 514 | "name": "python", 515 | "nbconvert_exporter": "python", 516 | "pygments_lexer": "ipython2", 517 | "version": "2.7.6" 518 | } 519 | }, 520 | "nbformat": 4, 521 | "nbformat_minor": 5 522 | } 523 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | aiohttp==3.9.3 2 | aiosignal==1.3.1 3 | annotated-types==0.6.0 4 | anyio==4.3.0 5 | appnope==0.1.4 6 | argon2-cffi==23.1.0 7 | argon2-cffi-bindings==21.2.0 8 | arrow==1.3.0 9 | asgiref==3.8.1 10 | asttokens==2.4.1 11 | async-lru==2.0.4 12 | attrs==23.2.0 13 | Babel==2.14.0 14 | backoff==2.2.1 15 | bcrypt==4.1.2 16 | beautifulsoup4==4.12.3 17 | bitarray==2.9.2 18 | bleach==6.1.0 19 | build==1.1.1 20 | cachetools==5.3.3 21 | certifi==2024.2.2 22 | cffi==1.16.0 23 | charset-normalizer==3.3.2 24 | chroma-hnswlib==0.7.3 25 | chromadb==0.4.24 26 | click==8.1.7 27 | coloredlogs==15.0.1 28 | comm==0.2.2 29 | dataclasses-json==0.6.4 30 | datasets==2.19.1 31 | debugpy==1.8.1 32 | decorator==5.1.1 33 | defusedxml==0.7.1 34 | Deprecated==1.2.14 35 | dill==0.3.8 36 | distro==1.9.0 37 | dnspython==2.6.1 38 | email_validator==2.1.1 39 | evaluate==0.4.2 40 | executing==2.0.1 41 | fastapi==0.110.0 42 | fastapi-cli==0.0.4 43 | fastjsonschema==2.19.1 44 | filelock==3.13.3 45 | flatbuffers==24.3.25 46 | fqdn==1.5.1 47 | frozenlist==1.4.1 48 | fsspec==2024.3.1 49 | google-auth==2.29.0 50 | googleapis-common-protos==1.63.0 51 | greenlet==3.0.3 52 | grpcio==1.62.1 53 | h11==0.14.0 54 | httpcore==1.0.4 55 | httptools==0.6.1 56 | httpx==0.27.0 57 | huggingface-hub==0.22.0 58 | humanfriendly==10.0 59 | idna==3.6 60 | importlib-metadata==6.11.0 61 | importlib_resources==6.4.0 62 | ipykernel==6.29.3 63 | ipython==8.22.2 64 | ipywidgets==8.1.2 65 | isoduration==20.11.0 66 | jedi==0.19.1 67 | Jinja2==3.1.3 68 | json5==0.9.24 69 | jsonpatch==1.33 70 | jsonpointer==2.4 71 | jsonschema==4.21.1 72 | jsonschema-specifications==2023.12.1 73 | jupyter==1.0.0 74 | jupyter-console==6.6.3 75 | jupyter-events==0.10.0 76 | jupyter-lsp==2.2.4 77 | jupyter_client==8.6.1 78 | jupyter_core==5.7.2 79 | jupyter_server==2.13.0 80 | jupyter_server_terminals==0.5.3 81 | jupyterlab==4.1.5 82 | jupyterlab_pygments==0.3.0 83 | jupyterlab_server==2.25.4 84 | jupyterlab_widgets==3.0.10 85 | kubernetes==29.0.0 86 | langchain==0.1.13 87 | langchain-community==0.0.29 88 | langchain-core==0.1.33 89 | langchain-openai==0.1.1 90 | langchain-text-splitters==0.0.1 91 | langsmith==0.1.31 92 | markdown-it-py==3.0.0 93 | MarkupSafe==2.1.5 94 | marshmallow==3.21.1 95 | matplotlib-inline==0.1.6 96 | mdurl==0.1.2 97 | mistune==3.0.2 98 | mmh3==4.1.0 99 | monotonic==1.6 100 | mpmath==1.3.0 101 | multidict==6.0.5 102 | multiprocess==0.70.16 103 | mypy-extensions==1.0.0 104 | nbclient==0.10.0 105 | nbconvert==7.16.3 106 | nbformat==5.10.3 107 | nest-asyncio==1.6.0 108 | networkx==3.2.1 109 | notebook==7.1.2 110 | notebook_shim==0.2.4 111 | numpy==1.26.4 112 | oauthlib==3.2.2 113 | onnxruntime==1.17.1 114 | openai==1.14.3 115 | opentelemetry-api==1.23.0 116 | opentelemetry-exporter-otlp-proto-common==1.23.0 117 | opentelemetry-exporter-otlp-proto-grpc==1.23.0 118 | opentelemetry-instrumentation==0.44b0 119 | opentelemetry-instrumentation-asgi==0.44b0 120 | opentelemetry-instrumentation-fastapi==0.44b0 121 | opentelemetry-proto==1.23.0 122 | opentelemetry-sdk==1.23.0 123 | opentelemetry-semantic-conventions==0.44b0 124 | opentelemetry-util-http==0.44b0 125 | orjson==3.9.15 126 | overrides==7.7.0 127 | packaging==23.2 128 | pandas==2.2.2 129 | pandocfilters==1.5.1 130 | parso==0.8.3 131 | pdfreader==0.1.15 132 | pexpect==4.9.0 133 | pillow==10.2.0 134 | platformdirs==4.2.0 135 | posthog==3.5.0 136 | prometheus_client==0.20.0 137 | prompt-toolkit==3.0.43 138 | protobuf==4.25.3 139 | psutil==5.9.8 140 | ptyprocess==0.7.0 141 | pulsar-client==3.4.0 142 | pure-eval==0.2.2 143 | pyarrow==16.1.0 144 | pyarrow-hotfix==0.6 145 | pyasn1==0.5.1 146 | pyasn1-modules==0.3.0 147 | pycparser==2.21 148 | pycryptodome==3.20.0 149 | pydantic==2.6.4 150 | pydantic_core==2.16.3 151 | Pygments==2.17.2 152 | pypdf==4.1.0 153 | PyPDF2==3.0.1 154 | PyPika==0.48.9 155 | pyproject_hooks==1.0.0 156 | python-dateutil==2.9.0.post0 157 | python-dotenv==1.0.1 158 | python-json-logger==2.0.7 159 | python-multipart==0.0.9 160 | pytz==2024.1 161 | PyYAML==6.0.1 162 | pyzmq==25.1.2 163 | qtconsole==5.5.1 164 | QtPy==2.4.1 165 | referencing==0.34.0 166 | regex==2023.12.25 167 | requests==2.31.0 168 | requests-oauthlib==2.0.0 169 | rfc3339-validator==0.1.4 170 | rfc3986-validator==0.1.1 171 | rich==13.7.1 172 | rpds-py==0.18.0 173 | rsa==4.9 174 | safetensors==0.4.2 175 | Send2Trash==1.8.2 176 | shellingham==1.5.4 177 | six==1.16.0 178 | sniffio==1.3.1 179 | soupsieve==2.5 180 | SQLAlchemy==2.0.29 181 | stack-data==0.6.3 182 | starlette==0.36.3 183 | sympy==1.12 184 | tenacity==8.2.3 185 | terminado==0.18.1 186 | tiktoken==0.6.0 187 | tinycss2==1.2.1 188 | tokenizers==0.15.2 189 | torch==2.2.1 190 | torchvision==0.17.1 191 | tornado==6.4 192 | tqdm==4.66.2 193 | traitlets==5.14.2 194 | transformers==4.39.1 195 | typer==0.10.0 196 | types-python-dateutil==2.9.0.20240316 197 | typing-inspect==0.9.0 198 | typing_extensions==4.10.0 199 | tzdata==2024.1 200 | ujson==5.10.0 201 | uri-template==1.3.0 202 | urllib3==2.2.1 203 | uvicorn==0.29.0 204 | uvloop==0.19.0 205 | watchfiles==0.21.0 206 | wcwidth==0.2.13 207 | webcolors==1.13 208 | webencodings==0.5.1 209 | websocket-client==1.7.0 210 | websockets==12.0 211 | widgetsnbextension==4.0.10 212 | wrapt==1.16.0 213 | xxhash==3.4.1 214 | yarl==1.9.4 215 | zipp==3.18.1 216 | -------------------------------------------------------------------------------- /talk-materials/beyond-the-hype.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-redactyl/simple-rag-document-qa/e33e2dd89ff2196cab11a12c5f657aa6322c8e44/talk-materials/beyond-the-hype.pdf -------------------------------------------------------------------------------- /talk-materials/talk-sources.md: -------------------------------------------------------------------------------- 1 | # Talk sources 2 | Below is a list of all the sources and media I used for this talk. 3 | 4 | ## Research 5 | * Washington Post, [The Google engineer who thinks the company’s AI has come to life](https://www.washingtonpost.com/technology/2022/06/11/google-ai-lamda-blake-lemoine/) 6 | * Harvard Business School, [Is AI Coming for Your Job?](https://hbswk.hbs.edu/item/is-ai-coming-for-your-job) 7 | * Ars Technica, [Warning of AI’s danger, pioneer Geoffrey Hinton quits Google to speak freely](https://arstechnica.com/information-technology/2023/05/warning-of-ais-danger-pioneer-geoffrey-hinton-quits-google-to-speak-freely/) 8 | * Stanford Computer Sciences, [History of Neural Networks](https://cs.stanford.edu/people/eroberts/courses/soco/projects/neural-networks/History/history1.html) 9 | * Ars Technica, [The generative AI revolution has begun—how did we get here?](https://arstechnica.com/gadgets/2023/01/the-generative-ai-revolution-has-begun-how-did-we-get-here/) 10 | * Wikipedia, [Large Language Model](https://en.wikipedia.org/wiki/Large_language_model) 11 | * CodeEmporium, [Transformer Neural Networks - EXPLAINED!](https://www.youtube.com/watch?v=TQQlZhbC5ps&list=PLTl9hO2Oobd_bzXUpzKMKA3liq2kj6LfE&index=9) 12 | * CodeEmporium, [GPT - Explained!](https://www.youtube.com/watch?v=3IweGfgytgY&list=PLTl9hO2Oobd_bzXUpzKMKA3liq2kj6LfE&index=11) 13 | * Yudkowsky (2022), [AGI Ruin: A List of Lethalities](https://www.lesswrong.com/posts/uMQ3cqWDPHhjtiesc/agi-ruin-a-list-of-lethalities) 14 | * MIT Technology Review (2023), [Geoffrey Hinton tells us why he’s now scared of the tech he helped build](https://www.technologyreview.com/2023/05/02/1072528/geoffrey-hinton-google-why-scared-ai/) 15 | * Agüera y Arcas & Norvig (2023), [Artificial General Intelligence Is Already Here](https://www.noemamag.com/artificial-general-intelligence-is-already-here/) 16 | * Bubeck et al. (2023), [Sparks of Artificial General Intelligence: Early experiments with GPT-4](https://arxiv.org/pdf/2303.12712) 17 | * Horace He's [CodeForces experiment](https://twitter.com/cHHillee/status/1635790330854526981?t=bdVc5pxCn1P_GV3ZF91X6w&s=35) 18 | * Sayash Kapoor's [CodeForces experiment](https://twitter.com/sayashk/status/1638159652562038787) 19 | * Narayanan & Kapoor (2023), [GPT-4 and professional benchmarks: the wrong answer to the wrong question](https://www.aisnakeoil.com/p/gpt-4-and-professional-benchmarks) 20 | * Chollet (2019), [On the measure of intelligence](https://arxiv.org/abs/1911.01547) 21 | * Morris et al. (2023), [Levels of AGI: Operationalizing progress on the path to AGI](https://arxiv.org/pdf/2311.02462) 22 | * Gao et al. (2024), [Retrieval-Augmented Generation for Large Language Models: A Survey](https://arxiv.org/pdf/2312.10997) 23 | * Hugging Face, [Open LLM Leaderboard](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) 24 | 25 | ## Image credits 26 | * [ChatGPT on mobile phone](https://www.pexels.com/photo/get-instant-answers-to-your-questions-with-chatgpt-your-pocket-ai-assistant-stay-connected-with-chatgpt-on-the-go-16689017/) 27 | * [Laptop in darkness](https://www.pexels.com/photo/photography-of-laptop-in-a-dark-area-986774/) 28 | * [Robot playing chess](https://www.pexels.com/photo/a-robot-playing-chess-8438880/) 29 | * [Book in black and white](https://www.pexels.com/photo/low-light-photo-of-opened-book-159872/) 30 | * [Person with laptop icon](https://www.flaticon.com/free-icon/computer-worker_7870360?term=laptop&page=2&position=1&origin=search&related_id=7870360) 31 | * [Tic tac toe icon](https://www.flaticon.com/free-icon/tic-tac-toe_9948487?term=tic+tac+toe&page=1&position=2&origin=style&related_id=9948487) 32 | * [Machine learning algorithm icon](https://www.flaticon.com/free-icon/classification_6045784?term=classification&page=1&position=1&origin=style&related_id=6045784) 33 | * [Car icon](https://www.flaticon.com/free-icon/classification_6045784?term=classification&page=1&position=1&origin=style&related_id=6045784) 34 | * [Person icon](https://www.flaticon.com/free-icon/user_3059518?term=person&page=1&position=1&origin=style&related_id=3059518) 35 | * [Planet icon](https://www.flaticon.com/free-icon/planet_763294?term=planet&page=1&position=34&origin=style&related_id=763294) --------------------------------------------------------------------------------