Introduction to Generative AI and LLMs

Day 1 – Lecture A

Menuka Bhandari

CFAES Bioinformatics Core, OSU

2025-07-13

Overview

  • Introduction to Artificial intelligence (AI) and Large language model (LLM)

  • Transformer architectures - Encoder only model, Decoder only model, Encoder-decoder model

  • Reinforcement Learning

  • Tokens, Context windows, Embedding

  • Chat-and-answer vs. agentic AI

  • Different models with different capabilities and costs

Introduction to AI

  • Artificial intelligence (AI)
    • Branch of computer science that simulates human intelligence and trains computers to learn human behaviors
    • Goal - make machines think like humans and learn human behaviors (reason, predict, and solve problems)
    • Combines machine learning, cognition, human-computer interaction, and data-driven decision-making
    • Applications in biology:
      • Protein sequence & structure prediction,
      • Functional DNA element recognition,
      • Drug discovery

Introduction to AI(cont.)

  • Artificial intelligence (AI)
    • AI branches relevant to bioinformatics fall into three categories:
      • Machine learning: Learns patterns from data. Example: Disease classification from gene expression data
      • Neural network: Learns complex biological patterns. Example: AlphaFold predicts protein structures
      • NLP: Enables computers to understand & generate language. Example: ProtBERT predicts protein function from protein sequences

Figure 1. Branches of AI

Introduction to LLM

  • Language model (LM)
    • LM is a statistical or machine learning model that learns the patterns and relationship within sequences
    • Predicts the most likely next word or token based on the surrounding context
    • Assigns a probability to different sequences — the more likely a sequence, the higher its probability
    • Example; Consider the two sentences:
      • The cat sat on the mat✅ (higher probability)
      • The cat sat on the refrigerator ❌ (lower probability)
    • Limitation of traditional LMs (e.g., N-gram models):
      • Struggle with rare or unseen words
      • Cannot capture long-range context and dependencies

Introduction to LLM (cont.)

  • Large language model (LLM)
    • Advanced LM trained on massive amounts of text to understand and generate human language
    • LLMs are built on Transformer architecture & trained on massive collections of data
    • Large in LLM - enormous number of model parameters and the vast quantity of training data
    • LLMs are trained to predict the next token or sequence of token in a piece of text

Introduction to LLM (cont.)

  • Large language model (LLM)
    • Predict the next word (token) based on context, enabling coherent text generation
    • Application - language translation, summarization, text generation, and coding assistance etc
    • Examples:
      • Commercial LLM - ChatGPT (Open AI), Claude (Anthropic) etc
      • Open soure LLM - Llama (Meta)
  • What can LLM do for the biological scientists?
    • Generate, explain, and debug code from natural language prompts
    • Automate complex workflows, troubleshoot errors, and analyze data
    • Enable researchers with limited programming experience to perform advanced analyses

Introduction to LLM (cont.)

  • Large language model (LLM)
    • Rapidly advanced since the introduction of the Transformer architecture in 2017
    • Modern LLMs such as GPT, Llama, Claude, Gemini, and DeepSeek have become increasingly capable due to larger datasets, improved training methods, & greater computational power

Figure 2. Evolution of LLM

Transformers

  • Transformer
    • Foundation of modern LLM introduced in 2017
    • Relies on a self-attention mechanism - enables model to analyze and weigh the importance of input sequence while making predictions
    • Processes the entire input sequence in parallel - faster and efficient computation
    • Ability to capture long-range dependencies within text

Figure 3. Transformer converting French word to English

Transformers

Why are Transformers powerful?
• Read the entire sequence at once
• Focus on the most important words (self-attention)
• Capture long-range relationships
• Train much faster

Analogy: Transformers treat biological sequences like language & learns how nucleotides in DNA or amino acids in proteins relate to one another, similar to how they learn relationships between words in a sentence.

Three Transformer architectures:
- Encoder-only model
- Decoder-only model
- Encoder-Decoder model

Transformer architectures

  • Encoder-only model (Google’s BERT)
    • Understands the input data
    • Process the input data and convert it to the contextualized internal representation (embedding)
    • Data is processed in bidirectional manner - understand context left and right side
    • Self attention - each token in a sequence can look at every other token in the same sequence to understand its context
    • Specializes in understanding and classification tasks

Figure 4.Encoder-only Transformer (BERT) architecture

Transformer architectures (cont.)

  • Encoder-only model (Google’s BERT)

    • Example; DNABERT is a AI model that uses DNA as a language
    • Tokens are generated based on k-mers (DNABERT) or Byte Pair Encoding (DNABERT-2)
    • DNABERT reads the entire DNA sequence and understand the biological function of even distant nucleotide bases
    • DNABERT recognizes important functional regions such as promoters, splice sites, and transcription factor binding sites

    Read → Understand → Predict

Transformer architectures (cont.)

  • Decoder-only model (OpenAI GPT series)
    • Designed to generate the output sequence/new sequence
    • Predicts the next token based on the context of previously generated tokens
    • Unidirectional - process sequence from left to right to predict what comes next
    • Optimized for text, code and coherent sequence generation
    • Example - ProGen
    • ProGen - protein language model trained on millions of raw protein sequences
    • ProGen predicts the next amino acid based on the amino acids that come before it generating entirely new protein sequences from de novo

Transformer architectures (cont.)

  • Encoder-decoder model (T5)
    • Combines both understanding (encoding) and generation (decoding)
    • Reads and understands the input before generating the output
    • Optimized for sequence-to-sequence prediction tasks
    • Example: Protein structure-sequence T5 (Prott5)
    • ProstT5 is a protein language model based on T5 encoder-decoder architecture
    • Predicts structural representations from protein sequences (and vice versa)

Transformer architectures (cont.)

  • Encoder-decoder model (T5)
    • The encoder learns a contextual representation of the input (sequence or structure), & decoder generates the corresponding output (structure or sequence)
    • This enables bidirectional translation between protein sequence and structural information
      Read → Understand → Translate

Figure 5.Encoder-decoder architecture

Reinforcement learning (RL)

  • A machine learning approach where an agent learns through trial and error
  • Agent interacts with an environment to maximize rewards and minimize penalties
  • Agent is a learning entity that makes decisions
  • Successful actions are reinforced, while poor actions are discouraged
  • Agent improves its decision-making through experience overtime
  • Advantage: Agent can learn in an unknown environment
  • Limitations: long training times, low sample efficiency and stability concerns

Reinforcement learning (RL)

  • Example; AI guided de novo Drug discovery to optimize drug candidates
  • In protein engineering, an AI model generates protein sequences, receives rewards for desirable properties (e.g., higher stability or stronger binding affinity), and uses this feedback to generate improved proteins over time

Figure 6. Reinforcement learning process

Tokens

  • Tokens could be words, characters or the combination of words and punctuation
  • Tokenization - converts raw text into smaller units called tokens which is a building block of LLM
  • The model uses these tokens together with their surrounding context to understand and generate language

How LLM understand tokens/text?

  • LLM break text into small pieces called tokens
  • Assign unique ID number to each token
  • Convert the token IDs into embeddings (lists of numbers)
  • Embeddings capture the meaning and relationships between words, helping the LLM understand context

Tokenization method

Level Example When It’s Used
Word level – text split into individual words “Transformers”, “are”, “cool” Simpler models, limited vocabulary
Subword level – text split into partial words “Transform”, “ers”, “are”, “cool”, “!” Most modern LLMs (Byte Pair Encoding, WordPiece, SentencePiece)
Character level – text split into individual characters “T”, “r”, “a”, “n”, “s”, … Languages with complex morphology or unknown words

Tokens

Example
Input : Transformers are cool

  • Tokens: [“Transformers”, “are”, “cool”]
  • Token IDs: [28471, 527, 9123] (unqiue IDs assigned by tokenizer)
  • Embeddings: Each token ID is converted into a numeric vector (hundreds or thousands of numbers)
  • LLM uses these embeddings to understand the sentence and predict the next token

Importance of tokens:
• Models read token not words
• Context window uses tokens
• Pricing is based on tokens

Embedding

  • After tokenization, each token ID is converted into a numerical vector (embedding)
  • Embeddings are continuous lists of numbers that AI model can understand process text mathematically
  • Similar words have similar embeddings, allowing the model to capture meaning, relationships, and context
  • Embeddings capture meaning, relationships, and context, enabling the LLM to understand language

Embeddings (vector embeddings): Learned numerical vectors that capture the semantic meaning and relationships between tokens

Context windows

  • Maximum number of tokens LLM can process at one time
  • Determines how much of a conversation or document the model can “remember”
  • Early LLMs had short windows, but newer LLMs have large context windows
  • Larger context windows allow the model to:
    • Process longer documents and conversations
    • Better understand context across the entire input
    • Produce more coherent and accurate responses
  • Larger context windows require more computation, making them slower and more expensive

Analogy: Think of the context window as the model’s working memory—the amount of information it can keep “in mind” while generating a response

Chat-and-answer vs. agentic AI

Chat-and-answer AI (Conversational AI)

  • Interacts with users using natural language
  • Answers questions, explains concepts, and generates content in real time
  • Common uses include brainstorming, coding assistance, document summarization, writing, and general knowledge questions
  • Example: ChatGPT, Microsoft Copilot, Google Gemini etc

Agentic AI

  • Goes beyond answering questions by planning and executing multi-step tasks
  • Designed to operate autonomously, make decisions, and execute complex tasks with minimal human supervision
  • Example: Claude Code, OpenAI Codex etc

Chat-and-answer vs. agentic AI

Feature Chat AI Agentic AI
Core purpose Answers questions and generates content Completes tasks to achieve a goal
How it works One prompt → one response Multi-step workflow with minimal supervision
Example task Explain a this error Fix the error, update the code, run tests, and verify the solution
Coding Writes or explains code Writes, edits, debugs, tests code in your project

Chat-and-answer vs. agentic AI

Feature Chat AI Agentic AI
Data analysis Explains how to analyze data Cleans data, runs analyses, creates figures, and summarizes results
Tool use Suggests commands or code Executes commands, edits files, calls APIs, and uses external tools (with permission)
Memory Uses information from the current conversation Tracks progress, remembers completed steps, and continues working toward the goal
Human involvement You guide every step You provide the goal; the agent manages many intermediate steps

Chat-and-answer vs. agentic AI (cont.)

Application of agentic AI in the analysis of omics field

  • Automating repetitive tasks
  • Supporting decision-making, including workflow design, parameter and software selection
  • Lowering computational pre-requisites
  • Enhancing data organization, management
  • Minimizing human errors - improving accuracy and reproducibility

Different models with different capabilities & costs

Selecting the Right LLM: There is no single best model for every task. Different models have different strengths, capabilities, and costs.

Factors to consider

  • Capability: How well does the model perform on reasoning, coding, scientific, or language tasks?
  • Cost: How expensive is it per million input and output tokens?
  • Speed: How quickly does the model generate a response?
  • Context window: How much text can the model process at once?
  • Multimodal Support: Can it work with text, images, audio, or video?
  • Deployment constraints: Can it be accessed via an API, run locally, or deployed in a secure environment?

Different models with different capabilities & costs

Model comparison based on Artificial Analysis data

Model Provider / Type Intelligence Index Output Speed, tokens/s Blended Price, USD / 1M tokens Best Interpreted As
GPT-5.5 xhigh OpenAI, proprietary 55 88 4.35 High intelligence but expensive
Claude Opus 4.8 max Anthropic, proprietary 66 54 3.85 Frontier reasoning and writing model
Gemini 3.1 Pro Preview Google, proprietary 46 152 1.74 Strong frontier model with comparatively high speed

Source: Artificial Analysis – LLM API Providers Leaderboard (accessed June 7, 2026).

Different models with different capabilities & costs

Choosing the right Claude model:

Model Best for Speed Cost
Fable 5 AI agents - long, complex tasks Slow High
Opus 4.8 Deep research and complex reasoning Medium Medium–High
Sonnet 5 Everyday use - Coding, writing, analysis, and multi-step workflows Fast Medium
Haiku 4.5 Simple tasks - anything you want done instantly Fastest Low

Different models with different capabilities & costs

Guidelines for selecting AI Model - There is no single “best” AI model. The right choice depends on your research task, budget, and workflow.

Research Task Key Considerations
Literature reviews & grant writing Strong reasoning, large context window, citation support
Coding & data analysis Coding ability, tool integration, reliability, cost
Long-document analysis Large context window, retrieval capabilities, cost
Qualitative or survey analysis Consistency, accuracy, ability to follow instructions
Large-scale data extraction Low cost, fast response, reliable structured outputs
Sensitive or confidential data Security, privacy, deployment options
Teaching & learning Ease of use, affordability, fast response
  • Test 2–3 models on a small sample of your actual research task.
  • Choose the model that best balances performance, cost, and reliability.