I love LLMs
Pradip Wasre

NLP Explorer

Pradip Wasre

NLP Explorer

Blog Post

Day 2 Blog: Mastering the Dimensions of LLM Engineering

January 3, 2025 Week 1

Welcome to Day 2 of my journey in mastering LLM (Large Language Model) engineering! Today, we’ll delve deeper into three critical dimensions of LLM engineering: Models, Tools, and Techniques. This blog will also cover practical applications and an upgrade to our Day 1 project to enhance our understanding and skills.

You Will Master These 3 Dimensions of LLM Engineering

1. Models

  • Definition: Models are the backbone of LLM engineering. They process input data to generate meaningful output.

  • Types:

    • Open-Source Models: Free to use and modify. Examples include GPT-3 and BERT.

    • Closed-Source Models: Proprietary models, often requiring a subscription or payment to use. Examples include OpenAI’s GPT-4.

    • Multi-Modal Models: These models handle multiple types of data, such as text, images, and audio. Examples include DALL-E and CLIP.

  • Architecture: The design and structure of the model, including layers, attention mechanisms, and embeddings.

  • Selecting Models: Choosing the right model based on the task, data availability, and computational resources.

2. Tools

  • Definition: Tools are software and libraries that facilitate the use, training, and deployment of LLMs.

  • Examples:

    • Hugging Face: A popular platform for deploying and using transformers.

    • Langchain: A library for building applications with language models.

    • Radio: Tools for audio data processing.

    • Weights & Biases: A platform for tracking machine learning experiments.

    • Moal: Tools for model monitoring and analysis.

3. Techniques

  • Definition: Techniques are methods used to optimize and interact with LLMs.

  • Examples:

    • APIs: Interfaces for interacting with LLMs programmatically.

    • Multi-Shot Prompting: Providing multiple examples in prompts to guide the model’s response.

    • RAG (Retrieval-Augmented Generation): Combining retrieval of relevant documents with generation to enhance output.

    • Fine-Tuning: Adjusting a pre-trained model on a specific dataset for a particular task.

    • Agentization: Turning models into agents that can interact with environments and perform tasks autonomously.

Targeted for a Wide Range of Background Experience

  • Too Easy: Hang in there! This course will build every day. There are challenging and fun projects coming up.

  • Too Challenging: Take your time with the practicals, use extra guides in week 1, and ask for help.

  • Just Right: Excellent!

Three Ways to Use Models

1. Chat Interfaces

  • Example: ChatGPT

  • Description: Interactive platforms where users can input queries and receive generated responses.

2. Cloud APIs

  • Frameworks: Langchain, Managed AI Cloud Services

  • Examples: Amazon Bedrock, Google Vertex, Azure ML

  • Description: Services that provide AI capabilities over the cloud. These platforms manage the infrastructure, making it easier to integrate AI into applications.

3. Direct Inference

  • Tools: HuggingFace Transformers Library with Ollama

  • Description: Running models locally on your machine. This approach offers more control and avoids API costs.

Upgrade Day 1 Project

Let’s upgrade our Day 1 project to summarize a webpage using an open-source model running locally via Ollama instead of OpenAI. This technique can be used for all subsequent projects if you prefer not to use paid APIs.

Benefits:

  1. No API Charges: Open-source models are free to use.
  2. Data Privacy: Your data doesn’t leave your local machine.

Disadvantages:

  1. Less Power: Open-source models may have less computational power compared to frontier models.

Example Code with Detailed Comments

Here’s the enhanced code to summarize a webpage using an open-source model with Ollama:

Github Repo : Link

Tags: