Exploring Large Language Models -Part 1

Introduction Large Language Models (LLMs) present us with two obvious capabilities - a natural language interface for communicating with the model and a vast amount of knowledge stored very efficiently in the models- the whole of the internet textual data. The larger the models are, the better they get at both of these capabilities. There is another capability that is not that obvious, but that could be the most powerful. It is implicit in the first capability and termed technically as NLU, Natural Language Understanding. To understand something, you need a model of that. For humans - a mental model. To understand language you need a model of language syntax and semantics. To understand a user question and to be able to answer that effectively the model needs an internal world model. There is a debate between thought leaders in this field on whether there is some internal world model learned by these LLMs, or if it seems to us as if it is present. However, their natural language understanding is so good, and their internal world model has enough information that they pass the Turing test as it was envisioned (https://www.nature.com/articles/d41586-023-02361-7) and also the Mini Turing Test based on Causal Reasoning proposed by current AI's most famous critic Judea Pearl. We will come back to this topic later. Still, this does not mean that they are intelligent in the real sense of the term, but we could more safely say, intelligent in understanding natural language. This is the key property that sets these models apart. LLMs start as dumb automata, but somewhere in their training, they become smart enough to generalize their training to tasks for which they are not explicitly trained. This is what we can more freely term as "understanding". As I mentioned before, this is a highly debated subject and our aim is not to go deep into the debate but to try to learn.


Exploring Large Language Models -Part 1

LLM Training and the Emergence of Understanding We can understand this topic in a more fun way by following the history of some famous AI/ML systems. Rule Engine/Tree Search We can start with IBM DeepBlue the chess-playing supercomputer. By using the power of a Super Computer and custom chips it defeated Gary Kasparov - the chess grandmaster in 1997. However, there was no AI or NeuralNet involved then, it was TreeSearch. You could abstract this a bit and say that it was a Rule-based engine. The training data was hand-coded domain expertise, distilled into a set of rules. The algorithm optimized the choice of the next move from a vast but computable result set based on the current state of its world. It was clear, however, that it was impossible to do this rule-based programming for broader domains. Supervised Training A decade later in 2011, IBM Watson -designed for Question Answering and specifically trained for Trivia QA played Jeopardy and won against a champion. There was a big hype around this as the next knowledge system that would revolutionise everything. The primary way the system was trained seems to be Supervised Training. That is data with labels on which the system was trained to pick the right answer or in this case, the right question. Supervised Learning works well. This is the bedrock of almost all machine learning used in production today. Given enough labeled data, AI/ML systems will learn to approximate any complex multivariate functions. They are excellent universal function approximators. The problem with Supervised Learning is that labelling huge amount of datasets for training huge models, need a lot of expensive and time-consuming human effort. The best example of one of the largest labeled datasets and its implication is Imagnet. It was the huge amount of labeled image data collected as part of the ImageNet project that helped AlexNet introduced in 2012 (Ilya Sutskever, Alex Krizhevsky and Geoffrey Hinton) revolutionize computer vision, though even by 1998 Yann LeCun and others and others had introduced LeNet-based convolutional neural network for handwriting recognition. Note Ilya Sutskever is also one of the founders of OpenAI and was instrumental in training the GPT models later. Back to the story. The hype surrounding IBM Watson died down over the years as the limitations of the system became apparent. A NY Times article gives insight into some of the challenges of why it could not generalize well to other fields like IBM hoped, the lack of properly labeled data being the primary. Reinforcement Learning In 2016, Google DeepMind AlphaGo became very popular by defeating the champion Go player. This game is a much wider domain /strategy than Chess (impossible for rule engine/tree search type algorithms). The key here was Reinforcement learning (RL). Here the training can be abstracted to making a random move, and if the move takes you closer to winning (though some loss calculation) make more of such moves and vice versa. And then they created agents and pitted the agents against each other, thereby playing probably thousands of years worth of games and getting good at the game. A more complicated game than Go is Dota, and in 2019, a small company (at that time) called OpenAI defeated the current reigning Dota 2 champions Here is an interesting snippet related to this event. The last word 'scale' is an interesting part that may suggest how they used this concept for their future work in GPT models DeepDive - Tough RL looks like it can be used for everything (for example, this is how a baby learns to walk or most organisms learn), outside of domains like games which have a very limited or controlled state space, it is very difficult to implement. For example, in a self-driving car, any small state change in some previous step can contribute later positively or negatively. It boils down to implementing a loss function that can store and work temporarily. (https://stanford.edu/~ashlearn/RLForFinanceBook/book.pdf, Why backpropagation approximation is needed for RL https://stats.stackexchange.com/a/340657/191675) So we covered supervised learning ( the bread and butter of AI/ML algorithms so far) and Reinforcement Learning - mostly in Video games and similar. Unsupervised Learning - The Holy Grail of all Learning? Before we go there to explore what he means by "Holy Grail", let's step back to make the context clear and explore what engineers usually mean when they say unsupervised learning and what is meant here. What he means here in short, is a higher-level learning abstraction and not the actual implementation. It is still a mystery how a network trained to predict the next tokens can generalize so much as the LLMs; that is, they learn to generalize in an unsupervised manner, though the training is supervised next token prediction. The usual take on Unsupervised Learning When we usually speak of unsupervised learning in ML, it is a few algorithms related to Clustering, for example, k-means clustering, Dimensionality Reduction, Principal Component Analysis, or Time series fitting. These are based on maths or matrix properties. These are all pretty complex but if you are good at maths or if you put enough effort, these can be clearly understood. In the case of Deep learning, the lower-level example is AutoEncoders. Autoencoders are more interesting in the context of LLMs in how they learn structures for internal compressed representation. In Autoencoders the target is the same as the input. That is, given complex data (say a highly detailed image) train a shallow network to give similar output. For this, the network needs to learn some pattern in the data to compress this sufficiently. See more http://ufldl.stanford.edu/tutorial/unsupervised/Autoencoders/ In this article, we are focussing not on the above classic ML or DL use-case but on unsupervised learning for LLMs. As such, there is nothing extraordinary here. We have seen the usual so-called unsupervised learning (in the context of LLM) via supervised training, the loss function, the training ( based on the usual gradient descent and backpropagation) Ilya Sutskever describes this https://youtu.be/AKMuA_TVz3A?t=490 So, from the humble supervised training, the mysterious un-supervised learning evolves The Emergence of Understanding The paper Language Models are Unsupervised Multitask Learners introduced GPT-2 to the world based on Transformer architecture. It did something very extraordinary. It proved empirically that a sufficiently large LLM, when trained with a sufficiently large dataset (CommomCrawl / WebText- cleaned up internet data) starts to "understand" the language structure. I am deliberately not using the less controversial term 'generalize' instead of 'understand' here to convey the meaning to all better. Here is a Google/DeepMind research paper that is easy to read on this topic https://arxiv.org/pdf/2206.07682.pdf. The same authors have discussed this with better visuals (below) There are other studies like this refuting this, and this debate has just started. The paper links to the inability of the LLM in maths, which is of course, not its forte. To really understand something and not just be a probabilistic distribution generator, one needs essentially a learned internal world model as well -according to Ilya Sutskever. This makes it completely different from other forms of ML and AI. To make this clear, here is a sample input and output from the ChatGpt4 model. The model has not been explicitly trained in automobile driving. But you can see that it has formed a world view or world model from its training data and can comprehensively reply. It is not clear how the emergence of understanding happens when training and model parameter scales, as what we simplify as a probability distribution function generator or dismiss as stochastic parrots may have more revelations in future research. The role of randomness, or its study/measure - probability, in complex interfacing systems, for example, as presented in The Blind Watchmaker, related to evolution and physics at the quantum level sometimes makes one reflect if there is any other way other than probability distribution functions to describe them. It needs more research and more structure to explain this more clearly. For example, I searched entropy and LLM and came to this paper Study of the possibility of phase transitions in LLMs and also a related talk by the founder of Wolfarm and scientist Stephen Wolfarm. So it is not far-fetched to think in these directions. Note that other signals that follow this property of language could also be effective candidates for LLM training, where instead of words, the signal could be tokenized. An example could be music https://ai.googleblog.com/2022/10/audiolm-language-modeling-approach-to.html. Similarly, structures that don't follow this model, like, say, DNA, could be a hard fit for these types of models. Coming back to the point - there is a race on how to tap this potential of LLMs in various fields. We will start with simpler ones and later with more expanded forms where the capability of reasoning of the model could be used in applications. We will cover this in Part 2 of the series.


This AI newsletter is all you need #63

What happened this week in AI by Louie This week in AI, we highlight further evidence of the adoption of Large Language Models (LLMs) driving significant revenue growth in the Western market, as well as the introduction of new AI models in China. OpenAI has reportedly achieved a revenue run-rate of $1 billion, marking a substantial and rapid increase from the $28 million recorded in 2022. All eyes are also on Nvidia's new H100 GPU chips, where the revenue run rate is reportedly now in the tens of billions. LLMs are no longer confined to niche research areas and ChatGPT has triggered a huge step change in demand for LLM products and infrastructure which is generating substantial revenue. This wave of interest has also triggered a significant influx of venture capital investments into the AI sector. However, it remains to be seen how quickly this wave of investment in AI APIs and infrastructure will translate into consumer products with lasting adoption. Chinese tech companies and universities have also made substantial investments in AI in recent years and have made significant contributions to machine learning. However, unlike other nations, China mandates that companies undergo security assessments and obtain clearance for AI models. This policy had previously delayed the public release of LLM chatbots in China. Nevertheless, this week marked an important development as China approved the release of new models from 11 firms. We are watching to see the adoption of these products in China and how they will stack up against models from Western competitors. While AI developments in China are promising, the US government has escalated sanctions on the supply of leading AI chips to China. This raises questions about the potential impact on progress. It remains unclear how extensive these restrictions will go and how Chinese AI projects will be able to compensate with less efficient chips, in-house chip designs, or Chinese chip fabrication, but we expect it to become an increasing challenge to train the most compute-intensive models going forward. - Louie Peters - Towards AI Co-founder and CEO This issue is brought to you thanks to invideo AI: Turn Any Idea Into Video With One AI Tool Imagine having a co-pilot to create videos - that's invideo AI. Transform your ideas into stunning visuals, instantly. Instruct the AI with text commands and get a ready-to-use video, including script, stock media, voiceover, and captions. Make edits and adjustments with simple text prompts. Creation just got 100x easier for content creators, YouTubers, and marketers. Test it out now - at no charge!


This AI newsletter is all you need #63

Hottest News X's Privacy Policy Confirms It Will Use Public Data To Train AI Models X's recently updated privacy policy informed its users it would now collect biometric data as well as users' job and education history to help train AI and machine learning models. Some reports speculate that Elon Musk may have acquired Twitter partially for its vast amount of proprietary training data, which could be used to train systems for his new AI company. 2. Google Goes All In on the AI Cloud Google recently showcased an expanded ecosystem that includes both global systems integrators and smaller cloud service providers, promoting the widespread adoption of Google's offerings worldwide. Although Google remains a distant third in the infrastructure-as-a-service/platform-as-a-service race, Google is adopting a long-term strategy and heavily investing in AI as a key driver of its cloud computing future. 3. WeatherBench 2: A Benchmark for the Next Generation of Data-driven Weather Models Google has released the WeatherBench 2 dataset, which is gaining attention in the AI weather forecasting field. Machine learning methods are proving to be just as effective as physics-based models but with the advantage of faster forecasts using affordable hardware. The WeatherBench 2 dataset aims to enhance ML research in weather forecasting. 4. Ideogram Launches AI Image Generator With Impressive Typography Ideogram is an alternative AI tool that excels in generating images with strong typography capabilities. It offers a unique feature of generating text within images, effectively addressing the common challenge faced by popular AI image generators. 5. AI Could Choke on Its Own Exhaust As It Fills the Web Experts are predicting that AI-generated content will soon dominate the web, but this poses risks such as information overload and degradation. One notable concern is "Model Collapse," wherein AI models overly rely on predictable word choices, potentially leading to a loss of their ability to produce engaging and nuanced content.


This AI newsletter is all you need #63

Five 5-minute reads/videos to keep you learning Transformers Revolutionized AI. What Will Replace Them? If modern artificial intelligence were to have a founding document, it would be Google's 2017 research paper, "Attention Is All You Need." This article delves into the concept of Transformers, outlines their limitations, and discusses potential alternatives to overcome these shortcomings. It presents compelling alternatives supported by sound logic. 2. ChatGPT Glossary: 41 AI Terms That Everyone Should Know With the pace of AI developments, it can be hard to keep up with the latest terminology. This glossary serves as a resource for those who are just being introduced to AI and for those looking for a reference or a vocabulary refresher. 3. Choosing the Right GPU Strategy for Your AI Project This guide delves into the decision of whether to rent or buy a GPU for your AI project. Owning a GPU provides stability, whereas renting offers adaptability. Freelancers may find renting beneficial for short-term projects, while long-term researchers may discover ownership to be more cost-effective. 4. Options for Solving Hallucinations in Generative AI This article tackles the issue of AI hallucinations in generative models and introduces a solution known as Retrieval Augmented Generation (RAG). RAG effectively mitigates hallucinations by retrieving pertinent context during data generation, making it a preferred choice for AI companies. 5. Vertex AI LLM Reinforcement Learning From Human Feedback The article offers a comprehensive guide for implementing Reinforcement Learning with Human Feedback (RLHF) on Google Cloud utilizing Vertex AI.


This AI newsletter is all you need #63

Papers & Repositories RLAIF: Scaling Reinforcement Learning from Human Feedback with AI Feedback New findings from Google suggest that Reinforcement Learning from AI Feedback (RLAIF) could represent a viable alternative to Reinforcement Learning with high-quality human preference labels (RLHF). RLAIF employs an off-the-shelf language model to label preferences and has the potential to address scalability limitations and enhance the efficiency of LLMs. 2. YaRN: Efficient Context Window Extension of Large Language Models This paper introduces YaRN, a computationally efficient method to extend the context window of such models, necessitating 10x fewer tokens and 2.5x fewer training steps than previous methods. It has been successfully employed to fine-tune LLaMa 2 7B and 13B models with context windows of 64k and 128k. 3. Qwen-VL: A Frontier Large Vision-Language Model with Versatile Abilities Alibaba Cloud introduces Qwen-VL, a powerful vision-language model designed for chat applications. Qwen-VL combines image and text inputs to generate accurate text and bounding box outputs, enhancing tasks such as image captioning, question answering, localization, and text-image understanding. 4. MedAlign: A Clinician-Generated Dataset for Instruction Following Electronic Medical Records MedAlign is a valuable dataset comprising 983 instructions for analyzing Electronic Health Record (EHR) data. Researchers utilized this dataset to evaluate the performance of six general domain language models. They identified significant error rates, with GPT-4 exhibiting a 35% error rate, and MPT-7B-Instruct having a 68% error rate. 5. OpenBMB / ChatDev ChatDev is a virtual software company that operates through multiple intelligent agents, each assigned different roles, including Chief Executive Officer, Chief Technology Officer, Programmer, Tester, and more. These agents within ChatDev collaborate by engaging in specialized functional seminars, encompassing tasks like design, coding, testing, and documentation. Enjoy these papers and news summaries? Get a daily recap in your inbox!


This AI newsletter is all you need #63

Meme of the week! Meme shared by neuralink


This AI newsletter is all you need #63

Featured Community post from the Discord Well.job has introduced Multilingual Semantic Search, offering semantic search capabilities with open source or OpenAI. This solution is crafted to function with any language and offers a straightforward and efficient means to conduct semantic search similarity, employing the FAISS library across various languages. Check it out on GitHub and support a fellow community member. Share your questions and feedback in the thread here.


This AI newsletter is all you need #63

AI poll of the week! Join the discussion on Discord.


This AI newsletter is all you need #63

Article of the week 10 Cool Things You Can Do With Embeddings! [Part 1] by Zubia Mansoor Taking a step away from classical machine learning (ML), embeddings are at the core of most deep learning (DL) use cases. Having a grasp of this concept enables you to do flexible tasks with the feature space, and reframe ML/DL problems differently, especially with high-dimensional data in Computer Vision and Natural Language Processing.


This AI newsletter is all you need #63

Our must-read articles Evolution in Your Code: Understanding and Coding Genetic Algorithm From Scratch - Part 1 by Francis Adrian Viernes Reinforcement Learning: Dynamic Programming and Monte Carlo - Part 2 by Tan Pengshi Alvin Machine Learning at Scale: Model v/s Data Parallelism by Shubham Saboo Steepest Descent and Newton's Method in Python, from Scratch: A Comparison by Nicolo Cosimo Albanese If you are interested in publishing with Towards AI, check our guidelines and sign up. We will publish your work to our network if it meets our editorial policies and standards.


This AI newsletter is all you need #63

Job offers Team Lead, Software Engineering @Persado (Remote) QA Software Testing Consultant - USA @ReVisionz (Remote) Principal Software Engineer - Vue.JS @Creative Chaos (Remote) Data Engineer @Mercari (Remote) Data Research Intern @Clarity AI (Madrid, Spain) Data Engineer @Decathlon (Singapore) Software Developer Internships - Summer 2023/24 @Phocas Software (Christchurch, New Zealand) Interested in sharing a job opportunity here? Contact sponsors@towardsai.net. If you are preparing your next machine learning interview, don't hesitate to check out our leading interview preparation website, confetti!


Natural Language Processing: Beyond BERT and GPT

1. The Legacy of BERT and GPT When we talk about BERT and GPT, it's a bit like discussing the legends of rock 'n' roll in the tech world. These two models didn't just appear out of nowhere; they were the culmination of years of research and experimentation in the field of Natural Language Processing (NLP). BERT, with its fancy name (Bidirectional Encoder Representations from Transformers), changed the game by looking at language in a whole new way. Instead of reading sentences from start to finish like we were taught in school, BERT reads them forwards, backwards, and every which way, ensuring it grasps the context of each word from all angles. It was like giving the computer a superpower to understand the deeper meaning behind our words. Then there's GPT, the Generative Pre-trained Transformer. If BERT was the rockstar, GPT was the pop sensation, making headlines for its ability to write essays, poems, and even stories that were eerily human-like. It showcased the sheer power of training a model with heaps of data, making it a master wordsmith. Together, BERT and GPT set the stage, creating a new era in NLP. They became the gold standard, the benchmarks against which new models were (and still are) measured. Their impact? Immeasurable. They've paved the way for a future where computers might just understand us as well as we understand each other.


2. The Rise of Transformer Variants The success of the transformer architecture, as showcased by BERT and GPT, was akin to discovering a new continent in the world of NLP. And just like any new land, it led to a flurry of explorations and adaptations, each trying to harness its potential in unique ways. One of the standout explorers was XLNet. While BERT was a master of context, XLNet took it a step further. It used a permutation-based approach, which means it looked at sentences in all possible orders, ensuring a dynamic and comprehensive understanding of context. It was like reading a book in every possible sequence to grasp every nuance. Then came RoBERTa, which can be thought of as BERT's smarter sibling. It took the essence of BERT and optimized it. By removing certain tasks like next-sentence prediction and training with more data and longer sequences, RoBERTa achieved even better performance. Another exciting development was the T5 (Text-to-Text Transfer Transformer). Instead of designing a unique model for each NLP task, T5 simplified things. It treated every task, be it translation, summarization, or question-answering, as a text-to-text problem. This universal approach made it versatile and powerful. These variants, and many more, are a testament to the transformative potential of the transformer architecture. They represent the ongoing quest to refine, adapt, and innovate, pushing the boundaries of what's possible in NLP.


3. Efficient Training and Few-shot Learning As these NLP models grew in complexity and size, a new challenge arose: the immense computational power required to train them. It's like having a supercar but worrying about the fuel costs. This led to a focus on making these powerful models more efficient. Enter DistilBERT. Think of it as BERT's leaner cousin. It was designed to run faster and take up less space, all while retaining most of BERT's prowess. It achieved this by distilling the knowledge of BERT into a smaller model, proving that size isn't everything. ALBERT was another step in this direction. It cleverly reduced the number of parameters by sharing them across layers and factorizing the embedding layer. The result? A model that was as smart as its predecessors but much lighter on its feet. While efficiency was one side of the coin, the other was the ability to learn from fewer examples. GPT-3 showcased the magic of few-shot learning, where it could perform tasks with minimal guidance. Instead of needing thousands of examples, it could now learn from just a handful. This is a game-changer, as it reduces the dependency on vast labeled datasets, making NLP more accessible and versatile. Both these avenues - efficient training and few-shot learning - represent the next phase in the evolution of NLP. They address the challenges of today while laying the groundwork for the innovations of tomorrow.


4. Bridging Knowledge Gaps with External Memory While models like GPT-3 are impressive with their vast internal knowledge, there's always more to learn. Imagine if these models could instantly access external databases or knowledge graphs while processing information. That's the idea behind integrating external memory. Models like ERNIE have started to tap into this, pulling structured information from knowledge graphs. This allows for a richer understanding of context and better reasoning capabilities. For instance, while answering a question about a historical event, the model could reference real-time data from a database, ensuring accuracy and depth in its response. This fusion of internal model knowledge with external databases represents a significant leap in NLP capabilities.


5. Ethical Considerations and Debiasing As AI models become more integrated into our daily lives, their influence on decision-making processes grows. This brings to the forefront the ethical implications of their outputs. Biases in models, often a reflection of biases in training data, can lead to skewed or unfair outcomes. Addressing this is paramount. Researchers are now focusing on making models more transparent and developing techniques to identify and mitigate these biases. Tools are being designed to audit model outputs, ensuring fairness and reducing potential harm. As we rely more on AI, ensuring these models uphold ethical standards becomes not just a technical challenge but a societal one.


6. Multimodal Models: Combining Text with Vision The future isn't just about text. Imagine a model that doesn't just read your question but also observes a picture you provide to give a more informed answer. That's the magic of multimodal models. Pioneers like CLIP and ViLBERT are leading the charge in this space, merging vision and language understanding. For instance, you could ask, "What's the emotion of the person in this picture?" and the model, by processing both the text and image, could respond accurately. This combination promises richer interactions, where AI can understand and generate content that spans multiple modes of human expression.


7. The Road Ahead BERT and GPT were just the beginning. As we venture further into the realm of NLP, the horizon is filled with possibilities. The focus is now on models that are not just smart but also efficient, ethical, and more in tune with human-like understanding. We're looking at a future where AI doesn't just understand text but emotions, context, visuals, and perhaps even abstract concepts like humor and sarcasm. The journey ahead is filled with challenges, but each one presents an opportunity to redefine our interaction with machines, making them more intuitive, helpful, and aligned with our needs.


AI Image Fusion and DGX GH200

The Art of Stitching Image stitching isn't just an algorithmic challenge; it's an art form. Stitching algorithms strive to seamlessly combine multiple images into one, expansive output, free from seams, distortion, and color inconsistency. Open-source methods vary in complexity from traditional feature-matching algorithms like SIFT and SURF to deep learning models like DeepStitch.


AI Image Fusion and DGX GH200

Traditional vs. Deep Learning Traditional Methods: Algorithms like SIFT (Scale-Invariant Feature Transform) and SURF (Speeded-Up Robust Features) use key points and descriptors to find overlapping regions between images. These methods are fast and work well for simple use cases but can struggle in more complex scenes.Deep Learning Models: Solutions like DeepStitch go beyond by using neural networks to find optimal stitching points, providing higher accuracy, especially in complex scenes. Below are available open-source algorithms or libraries for image stitching and panoramas.


AI Image Fusion and DGX GH200

Measuring in a 2D World Image stitching allows us to expand our visual horizon, but what about understanding the world within that field of vision? That's where image measuring comes in. From using simple Euclidean distance calculations in a calibrated setup to leveraging deep learning models that can identify and measure objects, the techniques are diverse.


AI Image Fusion and DGX GH200

Simple to Complex Calibration Methods: Techniques like camera calibration provide a way to relate pixel dimensions to real-world dimensions. Once calibrated, even simple geometric formulas can yield accurate measurements.Object Detection and Tracking: Deep learning models like YOLO or SSD are proficient at identifying objects in both images and real-time videos, paving the way for automated measuring. Below are available open-source methods for measuring and photogrammetry.


AI Image Fusion and DGX GH200

Stitching and Measuring: Two Sides of the Same Coin You might wonder why we're discussing both stitching and measuring together. The reason is they often go hand-in-hand. For example, in surveillance applications, a stitched panoramic view of a location can be used to track and measure the distance between multiple targets accurately. In medical imaging, stitched images from different angles can provide a more comprehensive view, facilitating more precise measurements.


AI Image Fusion and DGX GH200

TL;DR for CV Pixels Whether you're a hobbyist, a researcher, or someone intrigued by the applications of CV, both stitching and measuring are integral techniques to understand. While traditional algorithms offer a quick and straightforward approach, the advent of deep learning has opened the door to unprecedented levels of accuracy and complexity. It's a thrilling time to delve into the world of CV, where the boundary between the pixel and the panorama continues to blur, offering us a clearer view of the bigger picture. The field is advancing at a rapid pace, and it's crucial to stay updated with the latest algorithms and methodologies. So go ahead, stitch your way through panoramas, and measure your world, one pixel at a time!


AI Image Fusion and DGX GH200

AI Giant Foundation: DGX GH200 After leveraging AI/CV for advanced stitching and measuring capabilities, we also recognize the foundational role of GPUs in powering our AI-driven solutions. In this transformative age of AI, Nvidia's DGX GH200 AI Supercomputer stands as a monumental advancement. This computational behemoth, with a single GPU as heavy as four elephants, redefines what's possible. Far from being just a large machine, its unparalleled capability offers a stunning 144TB of shared memory across 256 NVIDIA Grace Hopper Superchips (GH200). This empowers developers with nearly 500x more memory, enabling the creation of complex, large-scale models to tackle today's most challenging problems. Truly, it's not just a machine, but the future of AI materialized.


AI Image Fusion and DGX GH200

Towards GH200 NVIDIA GH200 Grace Hopper Superchip integrates NVIDIA's Grace and Hopper architectures through NVLink-C2C, offering a coherent CPU+GPU (H100) memory model optimized for AI and HPC applications. As the ninth-generation data center GPU, H100 Tensor Core introduces a new Transformer Engine, boasting up to 9X faster AI training and 30X faster AI inference compared to its predecessor, A100. In a strategic rebranding move in May 2020, Nvidia transitioned its Tesla GPGPU line to Nvidia Data Center GPUs to sidestep brand confusion with Tesla automobiles. Originally competing with AMD's Radeon Instinct and Intel's Xeon Phi, these GPUs supported CUDA or OpenCL programming and were pivotal in deep learning and computational tasks. Spanning ten generations, each with distinct micro-architectures - Tesla, Fermi, Kepler, Maxwell, Pascal (P100), Volta (V100), Turing (T4), Ampere (A100, A40), Hopper (H100), and Ada Lovelace (L40) - Nvidia's data center GPUs have consistently pushed the envelope in deep learning and scientific computing.


Cracking the Code of Large Language Models: What Databricks Taught Me

The LLMs Program: A Brief Overview Databricks' Large Language Models program comprises two distinct yet interrelated courses: "LLMs: Application through Production" and "LLMs: Foundation Models from the Ground Up". The array of topics covered in these courses is as diverse as it is comprehensive.


Course 1: LLMs - Application through Production In the fast-paced world of technology, what sets this course apart is its laser focus on practicality. Aimed at developers, data scientists, and engineers, this course equips you with the skills needed to build LLM-centric applications using the latest frameworks. Here's a sneak peek at what you'll delve into: Harnessing the Power of LLMs: You'll learn to apply LLMs to real-world problems in NLP using popular libraries like Hugging Face and LangChain. Through hands-on exercises, you'll become proficient in leveraging these libraries for maximum impact.


Course 2: LLMs - Foundation Models from the Ground Up For those with a thirst for deeper knowledge, this course offers a plunge into the heart of LLMs. Ideal for data scientists and enthusiasts intrigued by the inner workings of foundation models, it covers the following: Understanding Foundation Models: Delve into the theory and innovations that paved the way for foundation models, including attention mechanisms, encoders, decoders, and their evolution to GPT-4.


Unpacking the Learning Experience Databricks' LLM courses are more than just another series of online lectures. They offer an immersive learning experience enriched with the wisdom of industry leaders and renowned researchers. A few standout features that make these courses remarkable:


Expert-Led Instruction In a domain as dynamic as AI, having mentors who have not only witnessed but actively shaped its evolution is invaluable. The expertise of the instructors infuses every lecture and lab, offering learners a unique perspective born from academia, startups, and F500 companies.


Hands-On Labs Theory without practice is like a ship without a compass. Databricks' courses are punctuated with hands-on labs that allow you to apply your newfound knowledge in real-world scenarios. These labs provide the practical skills you need to build your own production-ready LLM workflows.


Free Course Materials and Certificates In alignment with their commitment to democratizing AI, Databricks offers free access to course materials for anyone who wishes to audit. If you desire a deeper engagement, a nominal fee grants you access to a managed computing environment for course labs, graded exercises, and a completion certificate. This certificate, backed by Databricks' name, is a valuable addition to your professional profile.


Free Resources In addition to the courses, Databricks generously provides free resources, including source code and notebooks, ensuring that your learning journey continues beyond the course. The provided GitHub repositories offer a treasure trove of code examples and practical implementations.


Video Lectures For those who prefer a visual learning experience, Databricks offers a series of video lectures that accompany the courses. These lectures serve as an additional resource to enhance your understanding.


The Road Ahead: LLMs and Beyond As we approach the end of our exploration, it's crucial to recognize the immense potential and opportunities that await those who embark on this LLM journey. The data-driven world of tomorrow is bound to be AI-augmented, and enterprises across various industries are actively seeking talent with expertise in LLMs. According to IDC, 90% of enterprise applications will be AI-augmented by 2025, and the demand for professionals skilled in LLMs is on a meteoric rise. Job postings requiring both NLP and deep learning skills have seen a remarkable 105% increase in the last three years, according to Burning Glass. The potential career paths for graduates of Databricks' LLM courses are as diverse as the applications of LLMs themselves. From NLP/LLM engineers to data scientists, machine learning engineers, software developers, and research analysts, the possibilities are limited only by your imagination.


The Verdict: Should You Join the LLM Rebellion? In the spirit of a dramatic drumroll, let me make this clear - Databricks' LLM courses are an invaluable treasure chest for anyone serious about conquering the world of large language models. The knowledge, expertise, and experience you'll gain are worth their weight in gold-pressed latinum (for all you Trekkies out there). So, should you pursue these courses? Without a doubt! Whether you're a machine learning enthusiast or a data scientist looking to level up, Databricks' LLM courses are the hyperdrive you need to journey to the stars. Conclusion: Join the Journey As we conclude this odyssey through the galaxy of large language models, I urge you to embark on your own adventure. Databricks' LLM courses are not just a learning experience; they are a voyage into the future of machine learning. As you navigate the ever-expanding universe of data and language models, remember:


Resources Databricks' LLM Courses IntroductionLLM CertificationLLM Course 1: Application through ProductionLLM Course 2: Foundation Models from the Ground UpLLM Course 1: GitHub repo, Slides, Video LecturesLLM Course 2: GitHub repo, Slides, Video Lectures (coming soon)Transformers-Tutorials


Wild Wild RAG... (Part 1)

Cost of Vector Indexing, Search and Retrieval Now, let's delve into one of the central considerations - the cost of indexing. It's crucial to understand that when it comes to building a production-ready application, relying solely on free in-memory options is not advisable. Let's walk through a conservative estimation for building embeddings from an internal knowledge base comprising 3.5 million pages or a million PDFs with an average of 3.5 pages. For simplicity, let's assume that each page consists of textual content only, devoid of images. Each page, therefore, roughly translates to 1000 tokens. If we break this down into chunks of 1,000 tokens each, we find ourselves with 3.5 million chunks, which subsequently convert to 3.5 million embeddings. For cost calculations, let's consider two leading options in this domain - Weaviate and Pinecone. We'll keep things straightforward and assess the monthly expenses across three key sections: One-Time Embedding Conversion Cost: For processing 3.5 million embeddings, the approximate cost comes to $350, at a rate of $0.0001 per conversion.Pinecone Performance-Optimized Vector Database (Standard): For a single replica, this option would cost approximately $650. This includes both indexing and retrieving costs. It's important to note that costs scale linearly as your requirements grow. Weviate, another viable choice, is likely to have a similar pricing structure.Cost for Query Embedding Conversion: Assuming 1,000 users making an average of 25 queries per day, with each query and prompt totaling 100 tokens, the cost for this section rounds up to approximately $10. The total monthly cost for indexing, at a moderate level, stands at approximately $1,000. Please note that this figure does not encompass the expenses associated with OpenAI LLM response generation and application hosting, which can be estimated to be roughly 5 to 7 times greater than the aforementioned cost or even more. Therefore, the vector store cost constitutes a significant portion, accounting for approximately 15 to 20% of the overall expenditure. To lower costs, you can consider hosting top embedding models, which also reduces vector store expenses by opting for an embedding size smaller than 1536. But you still have to pay for a vector store. In cases where functionality like similarity search metric and index remains consistent, what other factors should be considered when selecting a vector store out of 100+ options?


Wild Wild RAG... (Part 1)

Balancing Latency, Scale, and Recall Based on the scale and cost perspective, let's consider Client-Server Architecture for our vector stores. You can either choose to host it on the cloud or on-premise based on factors like your data volume, privacy and money. When it comes to vector stores, there are two significant types of latency to consider: Indexing latency and Retrieval Latency. In many use cases, Retrieval latency takes precedence over Indexing latency. This preference stems from the fact that indexing operations are typically sporadic or one-time tasks, while the retrieval of chunks similar to user queries occurs much more frequently, often in real-time and at scale through user interfaces.Recall, on the other hand, quantifies the proportion of true nearest neighbors found, averaged across all queries. Most vendors in this domain employ a hybrid vector search methodology that blends keyword and vector search techniques in various ways. Notably, different database vendors make distinct choices and compromises when it comes to optimizing either for recall or latency. Let's review Recall vs Queries/sec ANN Benchmarks on a standard dataset for cosine metric, a critical metric which offers insights into how well the database balances retrieval accuracy with query processing speed. A higher value signifies that the database can retrieve a greater proportion of relevant data at a faster query rate, providing an optimal blend of accuracy and performance for real-time applications. Scann, Vamana (DiskANN) and HNSW emerge as some of the best options on faster and accurate indices for search and retrieval. Now let's review the Recall vs Index size (kB)/Queries per second for the same, which is a valuable metric for assessing the efficiency and resource consumption of a vector database. A lower value indicates greater memory efficiency, optimizing performance and scalability of the vector database. In this context, Qdrant, Weviate and Redisearch emerge as some of the best options for memory-efficient databases. However, you can refer to the following image to learn about the underlying vector index used by each database. It's evident that a significant number of database vendors have chosen to develop their proprietary implementations of graph-based HNSW. These custom implementations often incorporate optimizations aimed at reducing memory consumption, such as combining Product Quantization (PQ) with HNSW. However, it's noteworthy that a select few have embraced DiskANN, which appears to deliver comparable performance to HNSW while offering the unique advantage of scaling to larger-than-memory indexes stored purely on disk. In our assessment, we refrain from relying on benchmarks provided by vendors, as they may introduce bias into the evaluation process.


Wild Wild RAG... (Part 1)

Inflexibility and No Continual Learning In a future scenario, where you might need to update your Large Language Model (LLM) or embedding model through fine-tuning, subscribe to an upgraded model, expand your embedding dimensions, or accommodate changes in your data, the need to re-index and the associated costs can be nothing short of a nightmare. This rigidity can significantly impede the agility and cost-effectiveness of your system's evolution.


Wild Wild RAG... (Part 1)

Index Error Handling and Curse of Dimensionality When encountering a situation where a text query fails to retrieve the pertinent context and instead delivers unrelated or nonsensical information, the root causes of this failure can typically be attributed to one of three factors: a) Lack of Relevant Text: In some cases, the relevant text chunk simply does not exist within the database. This outcome is acceptable as it suggests that the query may be unrelated to the dataset's contents. b) Poor Quality Embeddings: Another possible cause is the subpar quality of the embeddings themselves. In such instances, the embeddings are unable to effectively match two relevant texts using cosine similarity. c) Distribution of Embeddings: Alternatively, the embeddings themselves may be of good quality, but due to the distribution of these embeddings within the index, the ANN algorithm struggles to retrieve the correct embedding. While it is generally acceptable to dismiss reason (a) as the query's irrelevance to the dataset, distinguishing between reasons (b) and (c) can be a complex and time-consuming debugging process. This behavior becomes increasingly pronounced in the case of ANN algorithms dealing with a large number of high-dimensional vectors - a phenomenon often referred to as the "Curse of Dimensionality."


Wild Wild RAG... (Part 1)

Reevaluating Vector Search and Retrieval Methods If the primary goal of the vector search ecosystem is to fetch "relevant text" in response to a query, why maintain two separate processes? Instead, why not establish a unified, learned system that, when presented with a question text, provides the "most relevant" text as a direct output? The fundamental assumption that underpins the entire ecosystem is the reliance on similarity measures between vector embeddings to retrieve relevant text. However, it's important to recognize that there are potentially superior alternatives to this approach. Large Language Models (LLMs) are not inherently fine-tuned for similarity retrieval, and it's entirely plausible that other retrieval methods could yield more effective results. The deep learning revolution has imparted a valuable lesson: a retrieval system that is jointly optimized tends to outperform a disconnected process where embedding and Approximate Nearest Neighbors (ANN) operations are independent of each other. In an optimized retrieval system, the embedding process and the ANN component are intimately connected and aware of each other's intricacies, leading to more coherent and efficient information retrieval. This underscores the importance of holistic and integrated approaches when designing systems for information retrieval and context matching.


Wild Wild RAG... (Part 1)

Closing Remarks In the realm of Production-Ready Retrieval-Augmented Generation (RAG) applications and vector search, we've uncovered the challenges and opportunities in bridging language models with real-world knowledge. From the cost considerations of indexing to the delicate balance of latency, scale, and recall, it's evident that optimizing these systems for production requires thoughtful planning. The inflexibility of models highlights the importance of adaptability in the face of change. As we reevaluate vector search and retrieval for production environments, we find that a unified, jointly optimized system offers promise. In this ever-evolving landscape, we're on the cusp of creating more context-aware AI systems that redefine the boundaries of text generation and information retrieval. The journey continues...


Explaining Attention in Transformers [From The Encoder Point of View]

What is attention? In Figure 3, let's consider all three hidden states produced by the encoder. Instead of just relying on the last hidden state, the decoder now has access to all the hidden states produced by the encoder. The decoder generates output one word at a time, hence, we need a mechanism that informs the decoder which hidden state to prioritize to produce the output at each time step. For instance, to generate the first word "Je", hidden state #1 will be most important, for second word "suis", hidden state #2 is more important, and so on. Basically, at each time step, we need a different weighting scheme for the hidden states. This will tell the decoder which part of the input sentence it needs to focus on, in order to produce the output. In short, attention can be formulated as a weighted sum of the hidden states. The above sentence "Je suis etudiant" is pretty straightforward with a one-to-one mapping between the words for the input and output sentences. In the sentence below (Figure 4), we observe for the words "European Economic Area", the mapping of the words from France to English is reversed. In such cases, attention proves important in order to learn the correct mapping of words from one language to another. To summarize, the encoder processes the sentence word-by-word and stores the corresponding hidden states. These hidden states are then fed to the decoder where the attention mechanism is applied.


Self-Attention Attention is a weighing scheme to learn the mapping between input and output sequence, i.e. which part of the input is going to be important to produce the output at the current time step. Now, let's look at the sentences below. We need to know what does "it" refer to. Is it street or animal? This is crucial, especially in translating English into a gendered language, like French. Self-attention is a means to encode the relationship between words in the input sentence. In the first sentence in the example above, we look at all the words in the sentence and encode "it" in such a way that gives more weight to either animal or street than the other words. Now, let's look at the Transformer Architecture to understand how self-attention is implemented.


Transformer Architecture The first transformer was introduced in a paper in 2017. As it was developed for machine translation, it has an encoder and a decoder architecture. The encoder and decoder are made up of stacks of encoders and decoders, respectively. We are going to focus on the Multi-Head Attention block of the Encoder. To begin with, we generate vectors for each word (token) in a sentence using the word2vec model. The model takes a word as input and produces a vector that represents the meaning of the word. The vectors generated by the word2vec model tend to put words that are similar in meaning to be closer in the vector space, i.e. the words "chair" and "table" would be closer together compared to, let's say "chair" and "tiger". These vectors are then fed into the attention module.


How is self-attention computed? (Query, Key, Value) Previously, we calculated attention as a simple weighted summation of the hidden states in the RNN. Here, we are going to compute self-attention in a different way, using Query, Key, and Value. This is based on the concept of databases, where you have a lookup table, consisting of a key and a corresponding value. When someone queries the database, you match the query to the key and get some value based on the match. Let's consider a small database (see Table 1 below) with three keys: Apple, banana, chair, and a value associated with each key (10, 5, 2). If we have query = apple, then we get the output 10. But if we have query = fruit, what do we do? If we look at the table, the key "fruit" doesn't exist. We either throw an error or do something smarter. Can we relate fruit to the other keys in the data set? The word fruit is related in some way to apple and banana and not related to the chair. So let's say, fruit is related (0.6) times to apple, (0.4) times to banana, and (0.0) times to chair. These are essentially your attention values. Therefore, if we now have query = fruit, we get the output as 0.6 * 10 + 0.4 * 5 + 0.0 * 2 = 8. But how do we calculate the attention values? Let's begin by representing our query with a 4D vector. Similarly, we also represent the keys (apple, banana, chair) with a matrix using corresponding vector values. The attention scores can then be computed as


Now let's go a bit deeper into how this is implemented in the encoder. Let's start with a simple sentence, "Thinking machines". First, we generate fixed-length embeddings for each of these words; For each word, we need to compute the query, key, and value vector, using the following equations. We can also represent the inputs as a matrix, in our case, and the corresponding query, key, and value matrices as, Now, we can compute the attention values as,


Multi-Head Attention Now let's go back to our sentence, "The animal didn't cross the street because it was too tired". Here we see the adjective "tired" is also related to the animal. In the figure below, we see two attention heads; the first (orange) relates the query "it" to "animal" while the second (green) relates the query "it" to "tired". Thus together, the two heads form a better representation that links the words "it", "animal" and "tired". Therefore, with two attention heads, we have These produce 2 different scores; The final score is computed by concatenating the scores from both the attention heads and projecting it back to the D dimensions of the original input. By default, the transformer model uses 8 attention heads. With this, we have completed the understanding of attention from the encoder point of view of the transformer. The decoder uses a slightly different multi-head attention with masking. I will cover this in my subsequent posts.


GPTQ Quantization on a Llama 2 7B Fine-Tuned Model With HuggingFace

GPTQ: Post-training quantization on generative models In a groundbreaking paper [1], researchers unveiled GPTQ, a novel post-training quantization method that has the potential to reshape the world of language model compression. GPTQ is not only efficient enough to be applied to models boasting hundreds of billions of parameters, but it can also achieve remarkable precision by compressing these models to a mere 2, 3, or 4 bits per parameter without sacrificing significant accuracy. This cutting-edge technique is showcased by its ability to quantize massive models, such as OPT-175B and BLOOM-176B, in just a matter of a few GPU hours while maintaining minimal perplexity, a stringent measure of accuracy. On the practical front, the researchers have developed an execution harness that enables efficient operation of the compressed models for generative tasks. Remarkably, they achieved the milestone of running the compressed OPT-175B model on a single NVIDIA A100 GPU, or with only two more cost-effective NVIDIA A6000 GPUs. Additionally, bespoke GPU kernels optimized for compression result in significant speedups, further enhancing the practicality of these compressed models. What makes GPTQ stand out is its ability to quantize language models with hundreds of billions of parameters to the 34 bits/component range. This is a remarkable leap, as prior methods struggled to maintain accuracy below 8 bits and typically focused on smaller models. However, the study also highlights the complex tradeoffs between perplexity, bit-width, and model size induced by compression. But it comes with limitations. GPTQ does not currently offer speedups for actual multiplications due to the lack of hardware support for mixed-precision operands on mainstream architectures. Activation quantization is also not included in the current results but can be addressed through orthogonal techniques. In sum, GPTQ's ability to compress extremely accurate language models to unprecedented levels marks a significant milestone in the field of machine learning and language modeling. It paves the way for more efficient and accessible applications of these colossal models while pointing toward further research possibilities in the realm of model compression.


¿When you should use GPTQ? The answer to this question will depend on each specific case and on the base model to be used, but an approach that is being applied to numerous models and that is indicated by HuggingFace, and the article I mentioned before, is the following: Fine-tune the original LLM model with bitsandbytes in 4-bit, nf4, and QLoRa for efficient fine-tuning.Merge the adapter into the original modelQuantize the resulting model with GPTQ 4-bit I ran the first two steps in my previous article [3] and now that the AutoGPT library is integrated with the Huggingface ecosystem, we will execute the third step in an extremely simple way.


AutoGPT integrated with Hugging Face transformers The AutoGPTQ library emerges as a powerful tool for quantizing Transformer models, employing the efficient GPTQ method. Some efforts like GPTQ-for-LLaMa, Exllama, and llama.cpp, focuses on the quantization of the Llama architecture, but AutoGPTQ distinguishes itself by offering seamless support for a diverse array of transformer architectures. The Hugging Face team has taken a significant step to enhance accessibility to GPTQ, and they have integrated an inclusive Transformers API, simplifying the process of Low-Level Model (LLM) quantization for a wider audience. This integration includes essential optimization options, such as CUDA kernels, catering to common use cases. For users seeking more advanced quantization options, the Auto-GPTQ library remains a valuable resource, offering capabilities like Triton kernels and fused-attention compatibility, and ensuring versatility and adaptability in the world of transformer model quantization. Extracted from the Huggingface blog article "Making LLMs lighter with AutoGPTQ and transformers" [5].


Our approach to this task First, we will load our fine-tuned model Llama 2 7B 4-bit Python coder in a Colab session using a T4 with extra RAM. The model is loaded in 4-bit with bitsandbytes and then we execute about 12 examples to measure the inference time. In order to perform a simple evaluation of the performance at the inference time, we have taken as examples those whose input text was longer than 500 characters and in this way, we will try to better appreciate the impact of quantization during inference. You can extract the code to load this model in the description of the model in the hugging Face Hub. In my notebook, we will describe how to perform inference on the examples mentioned.


Quantize the model using auto-gptq,  transformers, and optimum The GPTQ quantization consumes a lot of GPU VRAM, for that reason we need to execute it in an A100 GPU in Colab. It takes about 45 minutes to quantize the model, less than $1 in Colab. You can find the code in this notebook in my repository. First, we need to install the libraries as it is recommended in the huggingface tutorial: Optimum library, Hugging Face's toolkit for training and inference optimization, provides the integration of AutoGPTQ into Transformers. The GPTQ algorithm requires calibrating the quantized weights of the model by making inferences on the quantized model. For quantizing a model using auto-gptq, we need to pass a dataset to the quantizer. This can be achieved either by passing a supported default dataset among ['wikitext2','c4','c4-new','ptb','ptb-new'] or a list of strings that will be used as your custom dataset. Now you just need to load the model using a GPTQ configuration setting the desired parameters, as usual when working with transformers, it is very easy: As mentioned, this code takes about 45 minutes to run and consumes a peak of 32 GB of GPU VRAM. "You will need a GPU to quantize a model. We will put the model in the CPU and move the modules back and forth to the GPU in order to quantize them. If you want to maximize your GPUs usage while using CPU offload, you can set device_map = "auto" " [6], hugging Face docs. Parameters are self-explained, 4-bit quantization, C4 dataset, and the tokenizer to use during quantization. The other two parameters take the default values: group_size: The group size to use for quantization. Recommended value is 128 and -1 uses per-column quantizationdesc_act: Whether to quantize columns in order of decreasing activation size. Setting it to False can significantly speed up inference but the perplexity may become slightly worse. Also known as act-order. Once you have your model quantized, it is time to upload it to the Huggin Face Hub and share it with the community. In my experiment using GPTQ, the reduction in model size is striking. My fine-tuned Llama 2 7B model with 4-bit weighted 13.5 GB on disk, but after quantization, its size was dramatically reduced to just 3.9 GB, a third of the original size. This feature is very attractive when deploying large language models.


Loading the GPTQ Model from Hugging Face Hub and making some inferences Probably, all of you know how to do that but just in case you think this could be more "trickier" than with other models, we will show you that it is as usual. Remember you need to load all the libraries, including optimum, accelerate, and, of course, auto-gptq . Then you can upload the tokenizer and the model into your notebook in a T4 GPU in Google Colab: Now we can check our GPU to confirm how much memory we are consuming and, indeed, we can see that the model occupies 5,053 GB. We repeat the performance evaluation we mentioned earlier, making inferences on a bunch of long examples to compare with the original model. Both inference processes were executed on a T4 GPU, the base model took about 1719 seconds per inference while the quantized model ran in about 8 to 9 seconds per inference, a half. All code and examples are well-explained in his notebook in my repository. Any suggestion or bug fixing is welcome.


References [1] ICLR 2023 paper "GPTQ: Accurate Post-Training Quantization for Generative Pre-Trained Transformers" [2] "GPTQ or bitsandbytes: Which Quantization Method to Use for LLMs - Examples with Llama 2" by Benjamin Marie. [3] "Fine-Tuning a Llama 2 7B Model for Python Code Generation" by Eduardo Muñoz [4] Original fine-tuned model in Huggingface "edumunozsala/llama-27b-int4-python-code-20k" [5] Hugging Face blog article "Making LLMs lighter with AutoGPTQ and transformers" [6] Hugging Face official documentation about GPTQConfig [7] "4-bit Quantization with GPTQ" by Maxime Labonne.


7 Lessons From Fast.AI Deep Learning Course

About the course The Fast.AI course is led by Jeremy Howard, a founding researcher of Fast.AI. He also used to be #1 on the Kaggle leaderboard. So you definitely can trust his expertise in Machine Learning and Deep Learning. The course covers the basics of Deep Learning and Neural Networks and also explains Decision Tree algorithms. The current version is from 2022, so I suppose the content has changed since previous reviews on TDS. This course is designed for people with some programming experience. In most cases, code examples are used instead of formulas. I must confess that it's easier for me to understand code after writing it for ages, even though I have a master's degree in Maths. The other nice feature of this course is a top-down approach. You start with the working ML model. For example, I made my first DL-powered app during the course's second week. It's an image classifier which can detect my favourite breeds of dogs. Then, within the following weeks, you dive deeper and understand how it all works. Let's move on to my main takeaways from this course.


Lesson #1: Maths you need to know to understand Deep Learning Let's start simple. I promise the following takeaways will be less trivial. I believe it's important to talk about it because many people are intimidated by Deep Learning. DL is considered rocket science, but it's based on a few mathematical concepts you could learn in a day. Neural Network is a combination of linear functions and activations. Here's a linear function. Since a combination of linear functions is also linear, we need activations that will add non-linearity. The most common activation function is ReLU (Rectified Linear Unit). It may sound scary, but actually, it's just a function like this. You can think about it as the barrier that signals need to overcome. If a signal is below the threshold (0 in our case), its information won't pass to the next layer of the Neural Network. A couple of other mathematical concepts that are used: SGD (Stochastic Gradient Descent) - an optimisation approach based on gradient calculation. You can read an article to get a high-level understanding of how it works.Matrix multiplication helps to perform calculations faster in batches. There's an excellent article about it as well.


Lesson #2: How to clean your data We are used to starting analysis with cleaning data. We've all heard the mantra "garbage in - garbage out" many times. Surprisingly, fitting a model first and then using it to clean your data may be more effective. You can train a simple model and then look at cases with the highest loss to find potential problems. In my previous article, this approach helped me to spot mislabelled images.


Lesson #3: How to choose a Computer Vision model There are so many pre-trained models nowadays. For example, PyTorch Image Models (timm) has 1 242 models. As a beginner, you usually feel stuck with many options. Luckily, there's a handy tool to pick up Deep Learning Architecture. This graph shows a relation between time on inference (how long it takes to process one image) and accuracy on Imagenet. As you might expect, there's a trade-off between speed and accuracy, so you should decide which is more important. It highly depends on your task. Do you need your model to be faster or more accurate? It's better to start with a small model and iterate. The rule of thumb is to create the first model on the first day. So, you could use simple models like Resnet18 or Resnet34 to be able to try different augmentation techniques or external datasets. Since you're working with a simple model, iterations will be fast. You can move on to slower model architectures when you find the best version.


Lesson #4: How to train large models on Kaggle Lots of beginners use Kaggle notebooks for ML. Kaggle GPUs have limited memory, so you may run out of memory, especially when using large models. There's a helpful trick that can solve this problem. It's called Gradient Accumulation. With Gradient Accumulation, we don't update weights after each batch but sum gradients for K batches. Then, we update the model weight with this accumulated gradient for total batch equal to K * batch_size , so for each iteration we have a K times smaller batch size. Gradient Accumulation is absolutely mathematically identical unless batch normalisation is used in the model architecture. For example, convnext doesn't use batch normalisation, so there's no difference. With such an approach, we are using significantly less memory. It means there's no need to buy giant GPUs - you can fit your model even on your laptop.


Lesson #5: What ML algorithms to use Nowadays, there are a lot of different ML techniques. For example, scikit-learn documentation has at least a dozen approaches to Supervised ML. Jeremy Howard suggested focusing on just a couple of essential techniques: If you have structured data, you should start with ensembles of decision trees (Random Forest or Gradient Boosting algorithms).The best solution for unstructured data (like natural texts, audio, video or images) is a multilayer neural network. Neural Networks are also applicable for structured data, but Decision trees are often easier to use: You can train a Decision Tree ensemble much faster.They have fewer parameters to tune.You don't need a special GPU to train them.More than that, Decision Trees are often easier to interpret and understand why you get such a result for each object, for example, which features are the strongest predictors and which ones we can safely ignore. If we compare Decision Tree ensembles, Random Forest is easier to use (because it's almost impossible to overfit). However, Gradient Boosting usually gives you a bit better results.


Lesson #6: Handy Python functions Even though I've been using Python and Pandas for almost ten years, I also found a couple of helpful Pandas life hacks. The well-known Titanic dataset was used to show the power of Pandas. Let's have a look at it. The first example shows us how to convert a column to a string, get the first letter and convert using a dictionary. Note that if a value isn't mentioned in the dictionary, then NaN will be returned. The next example shows how to calculate frequency using the transform function. This version is more concise compared to the merge I usually use. The last example is the most complex one on how to parse titles. It's worth looking at the first part df to understand how it works. You can execute code:df.Name.str.split(', ', expand=True) and see a data frame where names are split by commas across two columns. Then, we select column 1 and do a similar split based on the dot. The second line just replaces all cases not equal to Mr , Mrs , Miss or Master with NaNs. Frankly speaking, I would continue using my usual approach for the last case because IMHO it's easier to comprehend.


Lesson #7: ML tricks There are a lot of tricks and helpful techniques or tools mentioned in this course. Here are the ones I found helpful.


Multi-target model Surprisingly, adding another target to the Neural Network may help you increase your model's quality. Jeremy showed an example of a multi-target model for the Paddy Disease Classification competition. The goal of this competition is to predict rice disease by photo. We can predict not only disease but also rice variety, which may help the model learn valuable features. Features useful to predict rice variety may also be helpful for disease detection.


Finding an optimal learning rate The learning rate defines the step size for each iteration of SGD (Stochastic Gradient Descent). If your learning rate is too small, your model will fit very slowly. If it's too high, your model may never converge to optimum. That's why it's so important to pick the correct learning rate. Fast.AI provides a tool to help you do it with one line of code learn.lr_find(suggest_funcs=(valley, slide)) .


Test Time Augmentation Augmentations are changes to the images (for example, contrast improvements, rotations, or crops). Augmentations are often used during training to give a bit different images each epoch. But we can use augmentations at the inference stage as well. This technique is called Test Time Augmentation. It works pretty straightforward. We generate several versions for each image using augmentations and get predictions for each of them. Then, we calculate the aggregated result using maximum or average. The idea is similar to Bagging.


Enriching dates You can get more information from your dataset if you have dates in your dataset. For example, instead of just 20230901, you can look at separate features: month, day of the week, year, etc. Fast.AI has a function add_datepart for it, so you don't need to implement it yourself.


Unanswered question: Why sigmoid? During the course, I had only one theoretical question that was not thoroughly covered. As in many other ML courses, there's no explanation for why we use the sigmoid function and not the other one to convert the output of the linear model to probability. Luckily, there's a long read where you can find all the answers.


Deploy Your Company's Own Secure And Private ChatGPT with Azure OpenAI

Security and Privacy First, let's talk about the security of user data, as this is the main value proposition of this solution. The LLMs called by this application are the same models (gpt-3.5/gpt-4) used in ChatGPT but are hosted on Azure data centers utilizing Azure's own compute resources for inference (e.g., GPUs). Thus, any user data, like questions and the bot's responses, won't go through any OpenAI channel and resides solely in the Azure environment. The Azure OpenAI data privacy policy explicitly states that user data won't be shared with OpenAI and will not be used to train future OpenAI models. (See below) The chat history for each user is stored in a secure Azure storage (called Azure Cosmos DB) within the customer's own cloud environment and is also covered by a strict data privacy policy. Data stored in Cosmos DB supports redundancy options that enable backup of the data to multiple Azure data centers around the world.


Chat history Chat history is stored in Azure Cosmos DB for each unique user account.


Supported response formats Here are the supported output formats that I have tried so far. (There might be more.) Lists 2. Tables 3. Code 4. Scorecard 5. JSON 6. CSV 7. SVG


Comparison with 'retail' ChatGPT 'Premium' features like plug-ins, custom instructions, and code interpreters are not (yet) available in this solution. This application only uses API calls to Azure OpenAI models and won't deploy self-hosted models to the customer's own cloud environment. Customers are charged depending on the models used and the token consumption.


Understanding Flash-Attention and Flash-Attention-2: The Path to Scale The Context Lenght of Language Models

FashAttention v1 In the realm of cutting-edge algorithms, FlashAttention emerges as a game-changer. This algorithm not only reorders attention computation but also harnesses classical techniques like tiling and recomputation to achieve a remarkable boost in speed and a substantial reduction in memory usage. The shift is transformative, moving from a quadratic to a linear memory footprint in relation to sequence length. For most scenarios, FlashAttention does pretty well, but it does come with a caveat - it wasn't fine-tuned for exceptionally lengthy sequences, where parallelism is lacking. When tackling the challenge of training large Transformers on extended sequences, employing modern parallelism techniques like data parallelism, pipeline parallelism, and tensor parallelism is key. These approaches divide data and models across numerous GPUs, which can result in minuscule batch sizes (think batch size of 1 with pipeline parallelism) and a modest number of heads, typically ranging from 8 to 12 with tensor parallelism. It's precisely this scenario that FlashAttention seeks to optimize. For every attention head, FlashAttention adopts classical tiling techniques to minimize memory reads and writes. It shuttles blocks of query, key, and value from the GPU's HBM (main memory) to its speedy SRAM (fast cache). After performing attention computations on this block, it writes back the output to HBM. This memory read/write reduction yields a substantial speedup, often ranging from 2 to 4 times the original speed in most use cases. The initial iteration of FlashAttention ventured into parallelization over batch size and the number of heads. Those well-versed in CUDA programming will appreciate the deployment of one thread block to process each attention head, resulting in a grand total of batch_size * num_heads thread blocks. Each thread block is meticulously scheduled to run on a streaming multiprocessor (SM), with an A100 GPU boasting a generous count of 108 of these SMs. This scheduling prowess truly shines when batch_size * num_heads reaches considerable values, say, greater than or equal to 80. In such instances, it allows for the efficient utilization of nearly all the GPU's computational resources. However, when it comes to handling lengthy sequences - usually associated with small batch sizes or a limited number of heads - FlashAttention takes a different approach. It now introduces parallelization over the sequence length dimension, resulting in remarkable speed enhancements tailored to this specific domain. When it comes to backward pass, FlashAttention opts for a slightly altered parallelization strategy. Each worker takes charge of a block of columns within the attention matrix. These workers collaborate and communicate to aggregate the gradient concerning the query, employing atomic operations for this purpose. Interestingly, FlashAttention has discovered that parallelizing by columns outperforms parallelizing by rows in this context. The reduced communication between workers proves to be the key, as parallelizing by columns entails aggregating the gradient of the query, while parallelizing by rows necessitates aggregating the gradient of the key and value.


FlashAttention-2 With FlashAttention-2, the Stanford team implements thoughtful refinement to the initial version, focusing on minimizing non-matmul FLOPs within the algorithm. This adjustment holds profound significance in the era of modern GPUs, which come equipped with specialized compute units like Nvidia's Tensor Cores, vastly accelerating matrix multiplications (matmul). FlashAttention-2 also revisits the online softmax technique it relies on. The goal is to streamline rescaling operations, bound-checking, and causal masking, all while preserving the output's integrity. In its initial iteration, FlashAttention harnessed parallelism across both batch size and the number of heads. Here, each attention head was processed by a dedicated thread block, resulting in a total of (batch_size * number of heads) thread blocks. These thread blocks were efficiently scheduled onto streaming multiprocessors (SMs), with an exemplary A100 GPU boasting 108 such SMs. This scheduling strategy proved most effective when the total number of thread blocks was substantial, typically exceeding 80, as it allowed for the optimal utilization of the GPU's computational resources. To improve in scenarios involving lengthy sequences, often accompanied by small batch sizes or a limited number of heads, FlashAttention-2 introduces an additional dimension of parallelism - parallelization over the sequence length. This strategic adaptation yields substantial speed improvements in this particular context. Even within each thread block, FlashAttention-2 must judiciously partition the workload among different warps, which represent groups of 32 threads operating in unison. Typically, 4 or 8 warps per thread block are employed, and the partitioning scheme is elucidated below. In FlashAttention-2, this partitioning methodology sees refinement, aimed at reducing synchronization and communication between various warps, thereby minimizing shared memory reads and writes. In the previous configuration, FlashAttention divided K and V across 4 warps while maintaining Q's accessibility for all warps, referred to as the "sliced-K" scheme. However, this approach exhibited inefficiencies, as all warps needed to write their intermediate results to shared memory, synchronize, and then aggregate these results. These shared memory operations imposed a performance bottleneck on FlashAttention's forward pass. In FlashAttention-2, the strategy takes a different course. It now allocates Q across 4 warps while ensuring K and V remain accessible to all warps. After each warp conducts matrix multiplication to obtain a slice of Q K^T, they simply multiply it with the shared slice of V to derive their respective output slice. This arrangement eliminates the need for inter-warp communication. The reduction in shared memory reads/writes translates into a significant speedup. The earlier iteration of FlashAttention supported head dimensions up to 128, sufficient for most models but leaving some on the sidelines. FlashAttention-2 extends its support to head dimensions up to 256, accommodating models like GPT-J, CodeGen, CodeGen2, and StableDiffusion 1.x. These models can now harness FlashAttention-2 for enhanced speed and memory efficiency. Furthermore, FlashAttention-2 introduces support for multi-query attention (MQA) and grouped-query attention (GQA). These are specialized attention variants where multiple heads of the query simultaneously attend to the same head of key and value. This strategic maneuver aims to reduce the KV cache size during inference, ultimately leading to significantly higher inference throughput.


The Improvements The Stanford team evaluated FlashAttention-2 across different benchmarks with notable improvements over the original version and other alternatives. The tests included different variations on the attention architecture and the results were quite notable. FlashAttention and FlashAttention-2 are two of the fundamental techniques used to scale the context of LLMs. The research represents one of the biggest research breakthroughs in this area and is influencing new methods that can help increase the capacity of LLMs.


Choose Your Weapon: Survival Strategies for Depressed AI Consultants

Why It Is Important In the past, people had a clear understanding of which technologies and tools to use for their machine learning tasks. They were familiar with the processes of topic modeling and sentiment analysis; they knew all the libraries they used; and they felt like conductors in a symphony. However, with the advent of LLM, everything has changed. LLMs seem to rule them all, and interestingly, no one knows how LLMs work. Now, people are questioning whether they should still develop solutions other than LLM but know little about how to make LLM-based solutions accountable. There were significant distinctions between academic researchers, ML practitioners, and their clients. The researchers focused on the development of new concepts with all their fascinating academic magic; while clients were aware that ML consultants had expertise that they and their team lacked, the ML consultants took pride in delivering their unique contributions. Everyone was happy. However, emerging large language models have significantly changed the world. Nowadays, generative AI makes advanced AI capability much more accessible to end users, while most academic researchers are not able to research new foundation models because training a new model is too expensive. The ways all people use LLMs are the same: mostly prompting, very rarely fine-tuning. They are all puzzled by the hallucination problem, and the solutions are all experimental. Advanced math skills are not very important in LLM development. Thus, all LLM users are solving the same problem using the same technology and achieving the same outcome. As a result, LLMs have brought academic researchers, practitioners, and end clients closer together. ML consultants, who make a living by providing ML services may ask: How do we justify our profession in this scenario if the researchers are solving practical issues and the clients can use the cutting-edge AI tools on their own?


The First Principle Generative AI is such a vigorous field that new models, new products, and new theories are announced every week or two. It is not easy to keep up with the pace. But first things first, before we dive deep into each of the emerging developments, we need to go back to the first principle and think about what problem the technology is going to solve. This is a simple but effective strategy. There are so many new developments, and each one of them is trying to help certain people. If we apply this strategy, we can focus more on the technologies relevant to our goal. One example is prompt engineering. Prompt engineering has proved to be very useful. Many techniques have been developed, like in-context learning, chain of thoughts, tree of thoughts, etc. Some people foresaw the emergence of prompt engineer as a new title. Is this the future of the ML engineer? Let's think about why prompt engineering has been developed. Then we'll realize that people developed instruction-following LLMs to allow users to interact with LLMs in human language. Prompt engineering is mostly about structuring text in a way that can be better interpreted and understood by generative AI models. Although prompt engineering has a bunch of proven patterns that make it look technician-oriented, it is primarily aimed at helping low-experience users. The current complexity of prompt engineering is because we haven't learned how to make the LLMs reliably understand the prompt. With further development, prompt engineering may become so mature that everyone can achieve satisfactory results with brief training. ML professionals should learn prompt engineering skills, but unfortunately, prompt engineering does not provide strong job security as its primary goal is to lower the threshold, not to maintain it. If you consider prompt engineering to be your core capability, the knowledge gap between you and your clients is getting narrower. In addition to the CLI and GUI, someone has proposed the idea of NLI, or Natural Language user Interface. I do believe this is a good idea. If you share the same idea, you'll agree that prompts must be available to everyone. It should not be a tightly held secret at all.


Knowing the Limitations Generative AI has received a lot of praise, but it has its own limitations. The model is keen to hallucinate, not good at logical reasoning, and not easy to harness. All these features make LLM applications difficult to develop and present opportunities for us to provide professional services and make generative AI more useful to deliver business values. To achieve this, in addition to knowing what generative AI can do well, it is essential to know about the areas where generative AI falls short, how to evaluate its performance, and how to mitigate these problems. Building up this kind of know-how will be invaluable in the long run. Let's consider the RAG application as an example. RAG is an essential building block in the generative AI ecosystem. It's the go-to option when we want to let the LLM base its reasoning on local data, and it's the right option when we want to handle contents that are much larger than the prompt window. Numerous RAG systems have been developed, and many vector databases have been created to keep up with this trend. However, RAG also has its own pitfalls. In fact, building an impressive RAG demo is fairly easy, but transforming it into a production-ready system can be quite challenging. Being aware of these limitations will help us become accountable consultants. Please go to the following posts to see relevant discussions if you want to know more about the RAG application: Disadvantages of RAG [2], considerations of applying vector databases [3], how to select and host embedding models [4], and how to fine-tune an embedding LLM [5]. Beyond the example of RAG, do you know how the LLM's performance was evaluated? Do you know what a prompt injection is and what prompt leakage is? You may have noticed in your practice that prompts are sensitive to nuance, but are you interested in measuring the robustness of your prompt? These are all practical questions and are the focus of many researchers. Although there are no perfect solutions to the questions yet, being aware of the concerns and remediations can still help a lot in our solution design. I hope these questions inspire you to see that there's so much we can do. All these questions and resolutions will build us into strong AI professionals.


Get the Big Picture Another important strategy is to think of the generative AI application as a whole system, not a single model. We know that LLMs have a lot of imperfections. Some of the imperfections are inherent flaws of the current LLM structure. Only ground-breaking new structures can solve those issues. As Yann Lecun said, "LLMs are not the future." While researchers are busy seeking alternative LLM architectures, we need to know that quite a few of the issues must be addressed with engineering solutions. There's an interesting article from the MIT Technology Review about Meta's failed LLM project last year [6]. Meta released a new LLM to generate scientific insights. However, the model only lived for 3 days before it was pulled offline. What has happened? After it was trained on 48 million scientific articles, textbooks, and lecture notes, the model could fabricate "scientific deep fakes". It produced fake scientific papers and falsely attributed them to real researchers. It hallucinated fictional Wiki articles, like the "history of bears in space". Imagine if a diligent scientist had used a fake reference that the LLM had provided. This is no doubt a very common LLM hallucination problem. Eliminating LLM's hallucinations is a tough battle. Even with all known remediations applied, we need to have a sense of what level of accuracy we can achieve. If the project requires zero tolerance for incorrect answers, a single LLM is probably not a good choice. Depending on the need, advanced solutions, like knowledge graph-backed ones, perform much better. The response would be more reliable and traceable, and the whole solution would be more manageable. Check out the following leaderboard to get a sense of realistic accuracy for a single model [8].


Responsibility Everyone would agree that the most significant problem with LLM is hallucinations. People have developed enormous strategies to control the problem. Besides hallucinations, are there any other issues that make decision-makers hesitate to apply generative AI to their systems? Let's have a look at a few of them:


Explainability Whenever we query for something, the LLMs always give us an answer. But how the models came up with that answer is unclear. How can we be sure how the model draws the response? Does it refer to any other reliable information, or is it just made up? To the RAG again: how can we know that the answer has included all important information or is incomplete?


Fairness All LLMs are trained on a large dataset. They are designed to discover patterns in the data. In this context, LLMs are just statistical models. And all statistical models are biased towards the most popular patterns. A common problem is that they don't perform well on the long tail. Consider a model built on the demographic data of Australia, where 80% of the population lives in the top 8 major cities. It generates good overall performance; however, it overlooks the interests of regional people and aboriginals. In some cases, these biases can be a show-stopper, which has become more important recently because of rising concerns about AI safety.


Safety Training a new LLM from scratch requires a large amount of training data and tonnes of money. Except for those who work for companies with very deep pockets, the majority of our LLM application developments have to be based on pre-trained foundation models. And this leads to two inherent risks: How can we know the training data is safe? It's so easy to sneak in malicious data to create a backdoor.How can we be sure the generated model is safe? Even though the training data is clean and clear, the generated model may be sensitive to adversarial attacks. You may already know that a computer vision model can be fooled by adding invisible noise to the input image. LLMs are sensitive to attacks as well. If we have to assume the training data and the model are unsafe, how can we detect, control, and manage the risk to prevent them from causing hazards?


Privacy and Data Security The LLMs are merely machine learning models. And their knowledge was built on the large training dataset. They have no sense of what kinds of data should be disclosed without restriction, which data should only be provided to certain groups of users, or which data should not be disclosed at all. Then, how do we guardrail the applications? How do we audit the privacy and security of the training data, and do we instruct LLMs to forget something we don't want them to remember?


Engineering is Our Home Field Awareness of all the above will give us a sense of what should be included in our knowledge base and in our project proposals. Our ideation can't go live without solid engineering. There are plenty of blank fields in Generative AI production. Quite a few aspects are either new concepts or need to be upgraded from old MLOps practices. Traditional MLOps are more focused on making sure the model's performance stays up to expectations, as well as the efficiency of training and the runtime environment. LLM applications do need efficient model hosting, fine-tuning, and runtime performance enhancement. In addition to that, we need to provide an engineering solution to each of the aforementioned concerns. These unique challenges make LLM operations more difficult to maintain than traditional MLOps can cope with. Take LLM model management as an example: we need to learn how to host a model on a GPU cluster efficiently, which is a MLOps skill. We also need to know all the skills of LLM model evaluation, model tuning, how to effectively prepare the training data, how to control model bias with the help of human-in-the-loop, how to control model risk with RLHF, etc. The task list is much longer, and the technical stack is much more complicated. We need to be hands-on with all of them. These are ways we can help our clients. Software developers have spent decades trying to find the best project management model. Numerous methodologies have been developed based on countless project failures. Eventually, people realized that communication was the key to project success. They found the Agile model to be the most efficient method, and Scrum became the de facto standard. The ML projects are much more complicated to communicate and much harder to keep everyone on the same page; however, there is no machine learning project-specific best practice yet. My interpretation is that it indicates the infancy of machine learning applications. I saw that communication is pulling back projects again. I expect some guy will come up with new Scrum adjustments to make the ML project run smoother. How can we deal with this challenge? My suggestion is to go over the boundary as much as you can. Don't limit yourself to a certain scope. Your project will benefit from your ability to bridge the gap between stakeholders.


Parting Words The emerging generative AI leads us into a blue sea of unlimited challenges and opportunities. At the moment, everything seems murky and fast-moving. There are so many things to learn, try, and solve every day. The good news is that, until the next ground-breaking innovation, the main Generative AI challenges are practical. Most of them are solving real-world problems and don't require advanced math skills. If we can make a plan for ourselves and build up our expertise in a planned way, we will find catching up with the latest developments easier. We can keep making ourselves resourceful ML consultants, and we have the opportunity to contribute our practices back to the ML community. I'm not sure how long this opportunity may last, but this is just awesome! As you can understand, this is a long journey. If you agree with my vision, please support me by subscribing and clapping, and I can share my progress with you.


This AI newsletter is all you need #65

What happened this week in AI by Louie This week in AI, we had developments in AI regulation from the Capitol: tech leaders such as Elon Musk and Mark Zuckerberg joined over 60 senators to chat about AI, and guess what? They all agree - it's high time for some ground rules. Elon Musk even said the meeting "may go down in history as very important to the future of civilization." The wheels of government might not be turning super fast on this, but the conversation is heating up about the need for Uncle Sam to step in with regulation. In an exciting development this week, OpenAI and Google are reportedly neck-and-neck in a race to release the next generation of LLMs, known as multimodal models. These AI systems have the unique ability to process both text and images seamlessly, promising to revolutionize everything from web design to data analysis. While Google has already previewed its upcoming Gemini multimodal model to some third parties, OpenAI is not far behind and aims to beat Google to public launch with multimodal capabilities. We are excited to experiment with powerful multimodal models as they become available and expect this to release a new wave of capabilities and applications in the AI landscape. - Louie Peters - Towards AI Co-founder and CEO


This AI newsletter is all you need #65

Towards X FlowGPT: Prompt Hackathon We are excited to announce our partnership with FlowGPT, which is hosting a Prompt Hackathon from 15th September to 14th October. Join their Discord community and explore the prompt hackathon. They are offering rewards of over $15,000 in cash, and this event is sponsored by Google! Additionally, FlowGPT will be hosting some thrilling AI/NLP-related events this month and the next. We are also collaborating with FlowGPT to organize one of our Learn AI Together Discord community workshops, where Ruiqi Zhong will provide insights into AI Alignment. Sign up for the event and learn more.