My lecture at MIT!✨
From Physics to Linear Algebra & Machine learning, I have learned a lot from MIT!
Yesterday, I had the honour of delivering a guest lecture on The state of AI Engineering, exploring:
- Prompt Engineering
- Retrieval Augmented Generation.
- Fine-Tuning Large Language Models.
- And, how LLMs are bringing a paradigm shift
Thank you @RoyShilkrot for the invitation! 🙏
Grateful for the opportunity to engage with such brilliant minds!
If you are interested AI Engineering, I write a free weekly newsletter → @ML_Spring
Build your own ChatBot in just a few lines of Code & run it on a CPU!
Here's what you'll need:
🔹Lit-GPT: A hackable implementation of open-source large language models, released under the Apache 2.0 license by @LightningAI. Supports all popular LLMs!
🔸Gradio: A free and open-source Python library for creating customizable UI components for machine learning models, APIs, or any Python function. It integrates with popular Python libraries.
🔹LangChain: An open-source framework aimed at simplifying the development of applications utilizing large language models (LLMs).
It offers a standardized interface for chains, numerous integrations with other tools, and end-to-end chains for common applications.
Hardware requirements for different models:
- Llama-7B model: 14 GB
- Llama-13B model: 24 GB
- 4-bit quantization: 8 GB
With Lit-GPT, you can easily utilize all the variants and perform quantisation.
I have shared all the relevant links and the code repository in the next tweet!
Check this👇
I built an agent that answers machine-learning questions.
It's autonomous, and the best part is that I built the whole thing without writing a single line of Python code.
Here is what I did and how I did it:
Over a year ago, a friend and I built a site that publishes multi-choice questions. You get a new one every day.
I decided to have GPT-3.5 answer questions.
Here is what I needed to build:
1. Connect to the site's API to retrieve today's question
2. Extract the question and the potential choices
3. Connect to OpenAI's API and ask GPT-3.5 to answer the question
4. Parse the answer from the model
5. Submit the answer back to the API to get the score
Not difficult. Likely several hours of work.
But I didn't have to write any code. I built the whole thing by dragging and dropping components using https://t.co/QfKGXEhD8t.
Vellum is a YC-backed platform for developers to build LLM applications. They are the only ones I've seen offering this functionality. They sponsored this post, and their team helped me with all my questions while I built this.
I created a workflow. The platform supports several node types to build whatever you have in mind. I show how I put the whole thing together in the attached video. The only code I had to write was a few lines of Jinja to parse and transform the API and the LLM results.
There are three lessons I want to share from this experience:
First, the best possible code is the one you didn't write. I'm a big fan of no-code tools because they help me materialize my ideas fast. They help product people, designers, and no coders collaborate on the solution.
Second, Large Language Models are sensitive to how you prompt them. Small changes to prompts can make a big difference in results. This is more pronounced when you are building a multi-step workflow.
Third, automated testing and evaluation for prompts is critical. There aren't many companies thinking about this. They'll have a hard time moving from a demo phase.
The attached video will show you what I did.
ANNOUNCING Giraffe - Long Context Open-Source LLMs - An AI Brain for your Organization
We are excited to invent and open-source Giraffe, the world's first commercially usable 32K long-context open-source LLM based on Llama-2
Our AI research paper details our inventions around context-length extrapolation. In layman's terms, context length is the amount of data you can send to a large language model (LLM) in one API call.
Context length becomes very important when building a Custom ChatGPT - An AI brain for your organization based on your knowledge base.
You are constrained by the amount of proprietary data you can send in one API call. So the bigger the context length, the better.
Today's SOTA open-source LLMs such as Llama 1 and 2 have one big shortcoming! These LLMs have a very small context length of only 2K. This makes them unusable in any enterprise land.
Our open-source model extends (extrapolates) context length from 2k to 32K! The longest context for an open-source model to date! This makes it super easy to send bigger documents to the LLM and get your questions/chats answered.
The 32K Giraffe can do more complex retrievals with fewer mistakes and is essential for maintaining long conversations, or for asking an LLM to help with coding on a large existing codebase.
The 32K Giraffe, can easily function like an AI brain for your business - boosting employee productivity, improving decision making and surfacing custom insights from your data
In addition, in our research paper, we showcase the two new approaches we have invented around context-length exploration and compare and test them thoroughly against other prominent approaches. One of our methods, called truncation shows some very promising results.
Our blog post has all the details including links to the paper, open-source models, and our git-repo
https://t.co/anYyRnR02i
Time-series forecasting - AI to predict the future
While LLMs and Gen AI have received a lot of attention, state-of-the-art (SOTA) time-series forecasting models almost seem magical when they can predict a future value with high accuracy. They are used to predict stock prices, weather, retail demand, economic indicators like inflation, interest rates, and even climate change.
Until recently statistical algorithms that work by analyzing historical data to detect patterns, trends, and relationships in the data were the standard way to do time-series forecasting.
The two most popular statistical methods are
ARIMA (AutoRegressive Integrated Moving Average): Combines autoregressive (AR), differencing (I), and moving average (MA) methods to model time-series data, capturing trends and seasonal patterns.
Exponential Smoothing: Utilizes weighted averages of past observations, with the weights decaying exponentially as the observations get older, to predict future values.
Recently, however, several deep learning algorithms, have outperformed statistical and classical machine learning methods. Here are the key steps involved in creating an applied AI system in forecasting.
Data Preprocessing: This data may need to be cleaned and transformed into a suitable format, such as normalizing or scaling the values.
Building the Neural Network: Different NN architectures are applicable to different problems.
LSTMs, an RNN can learn and remember long sequences.
widely used in forecasting where long-term dependencies exist. This might include stock price prediction, weather forecasting, etc.
CNNs utilize convolutional layers that can detect local patterns or features and can be applied to time series forecasting to recognize spatial patterns in sequences.
Current SOTA architectures tend to be Transformer architectures. They can capture long-range dependencies in data by using self-attention. They can also be used for time series forecasting by encoding the past values of the time series into a sequence of vectors and then decoding the vectors to produce the predicted future values.
Hyperparameter Tuning: Tuning and optimizing parameters like learning rate, number of layers, and the type of loss function that may apply can at times significantly improve model performance. Deep learning models come with many "knobs" you can turn to optimize performance, such as learning rate, number of layers, and number of neurons in each layer. Finding the right combination is essential but often tricky, and it may require experimentation.
Model Evaluation: Once your models are trained, you evaluate them by measuring how well they predict future values they haven't been trained on. Training multiple models using a variety of algorithms and picking the best model is recommended
Metrics like Mean Absolute Error (MAE) or Root Mean Squared Error (RMSE) are popular metrics that are used to quantify the difference between the predicted and actual values.
Deployment and Maintenance: Finally, the model may be integrated into a broader system to make ongoing predictions. Regular monitoring of drift, retraining, and updating is necessary, as changes in underlying patterns may cause the model's performance to degrade over time.
An end-to-end MLOps system can be used to set up pipelines, train and evaluate models and maintain them over time. We over at https://t.co/dJ2B4Jig2U have invented several DL techniques and provide a SOTA platform to create and deploy models.
@JiRongMFA We came here to China with an innovative mind, but here we can not choose the courses by our choice.
Here in China, we foreign students are treated as a number, not a talent.
@JiRongMFA Chinese students are making these robots. However, foreign students can not build a simple mobile application when they come home from China.
They do not allow foreign students to take such courses... Although chose an English medium, they teach in the Chinese language.
@JiRongMFA Dear Ma'am, China is very beautiful but in the eye of the camera. But, the life of a foreign student is full of depression, hate, and unlawfull.
@thinkers_12@SpokespersonCHN I am living in China.
China in the pictures sounds good, but in reality, China is different. This is a public place... I can't express my feelings during living in China. The life of a foreign student is totally depressed.
WHO is changing all areas of work to prevent and respond to sexual misconduct, which is translating into broad impact and increased accountability. There is #NoExcuse for sexual exploitation, abuse and harassment. Dr @GayaG at yesterday’s media briefing ⬇️https://t.co/ayC5xkMV4V