Category Archives: Generative AI

From Transformers to AI Agents: Practical Roadmap to Modern Large Language Models (LLMs) – Faculty Development Program at Rashtriya Raksha University

From Transformers to AI Agents: Practical Roadmap to Modern Large Language Models (LLMs) – Notes from Faculty Development Program / Short Term Training Program (Generative AI – From Foundations to Frontiers) that I attended at Rashtriya Raksha University

Article content
Article content

Artificial Intelligence is evolving rapidly. What began with language prediction has now expanded into multimodal reasoning, autonomous agents, and enterprise AI systems. Understanding the complete ecosystem—not just ChatGPT—is becoming an essential skill for engineers, researchers, architects, and business leaders.

1. LLM Internals – How an LLM Actually Works

  • Data collection → cleaning → tokenization
  • Tokens converted into embeddings (dense vectors)
  • Positional encoding preserves sequence information
  • Transformer architecture using:
  • Next-token prediction using Softmax probabilities
  • Training via gradient descent and backpropagation
  • Inference through autoregressive generation

Key idea: LLMs do not memorize sentences—they learn statistical relationships among billions of tokens.


2. Mathematics Behind LLMs

Modern LLMs combine mathematics from multiple disciplines:

  • Linear Algebra (vectors, matrices, tensors)
  • Calculus (gradients, derivatives)
  • Probability & Statistics
  • Information Theory (Entropy, Cross-Entropy)
  • Optimization (Gradient Descent, Adam)
  • Graph Theory
  • Numerical Computing
  • High-dimensional Geometry

Core mathematical concepts

  • Embeddings
  • Attention mechanism
  • Softmax
  • Loss functions
  • Cosine similarity
  • Matrix multiplication
  • Eigenvectors & Singular Value Decomposition (SVD)

Mathematics remains the foundation behind every AI model.


3. Multimodal LLMs

Today’s AI models understand much more than text.

They can process:

  • Text
  • Images
  • Audio
  • Video
  • Documents (PDFs)
  • Tables
  • Source code
  • Structured enterprise data

Applications include:

  • Medical diagnostics
  • Autonomous vehicles
  • Satellite & GeoAI
  • Robotics
  • Scientific research
  • Digital assistants

4. Fine-Tuning

Organizations often adapt foundation models to their specific domains.

Popular approaches include:

  • Full Fine-Tuning
  • Parameter-Efficient Fine-Tuning (PEFT)
  • LoRA
  • QLoRA
  • Instruction Tuning
  • Reinforcement Learning from Human Feedback (RLHF)
  • Preference Optimization (e.g., DPO)

Fine-tuning helps models learn organizational knowledge, terminology, and task-specific behavior.


5. Enterprise Applications

LLMs are transforming almost every industry.

Examples include:

  • Customer support
  • Knowledge management
  • Software development
  • Healthcare
  • Finance
  • Manufacturing
  • Legal document analysis
  • Education
  • Cybersecurity
  • Scientific discovery
  • Government services
  • Geospatial intelligence (GeoAI)

6. Retrieval-Augmented Generation (RAG)

Instead of relying only on training knowledge, RAG retrieves relevant information before generating a response.

Typical pipeline: Documents → Chunking → Embeddings → Vector Database → Retrieval → Prompt Construction → LLM → Answer

Benefits:

  • More accurate responses
  • Reduced hallucinations
  • Access to current enterprise knowledge
  • Better explainability

7. Common RAG Patterns

Modern RAG systems use increasingly sophisticated architectures.

Examples include:

  • Naïve RAG
  • Semantic Search RAG
  • Hybrid Search (Keyword + Vector)
  • Parent–Child Retrieval
  • Multi-Vector Retrieval
  • Graph RAG
  • Knowledge Graph RAG
  • Agentic RAG
  • Corrective RAG (CRAG)
  • Self-RAG
  • Multi-hop RAG
  • Hierarchical RAG
  • Multimodal RAG

The trend is shifting from “search then answer” to intelligent reasoning over enterprise knowledge.


8. AI Agents

Unlike traditional chatbots, AI agents can plan, reason, and execute tasks.

Agent capabilities include:

  • Planning
  • Tool usage
  • Multi-step reasoning
  • Memory
  • Reflection
  • Self-correction
  • Collaboration with other agents

Common frameworks:

  • LangGraph
  • CrewAI
  • AutoGen
  • Semantic Kernel
  • OpenAI Agents SDK

Agents are moving AI from conversation to autonomous execution.


9. Model Context Protocol (MCP)

MCP is emerging as a standardized way for AI models to interact with external systems.

It enables models to securely connect with:

  • Databases
  • APIs
  • Git repositories
  • Local files
  • Enterprise applications
  • Business workflows
  • Development tools

Think of MCP as a “USB-C for AI,” providing a common interface between models and tools.


10. Ethics & Responsible AI

As AI capabilities expand, responsible development becomes increasingly important.

Key principles:

  • Fairness
  • Transparency
  • Explainability
  • Privacy
  • Security
  • Bias mitigation
  • Human oversight
  • Accountability
  • Regulatory compliance
  • Sustainability

Responsible AI is not optional—it is fundamental to building trustworthy systems.


Final Thoughts

The future of AI lies at the intersection of Transformers, Mathematics, Multimodal Intelligence, Fine-Tuning, RAG, AI Agents, MCP, and Responsible AI. Professionals who understand these interconnected concepts will be well-positioned to design the next generation of intelligent systems that are accurate, scalable, secure, and impactful.

The next wave of AI is not just about larger models—it is about smarter architectures, richer context, reliable reasoning, and responsible deployment.

Here is a curated list of technical keywords from the topics in this FDP & Article:

LLM Internals & Mathematics

  • Self-Attention Mechanism
  • Transformer Architecture
  • Positional Encoding (e.g., RoPE)
  • Softmax Function
  • Gradient Descent
  • Cross-Entropy Loss
  • Backpropagation
  • Stochastic Gradient Descent (SGD)
  • Backprop-through-time (BPTT)
  • Layer Normalization

Multi-Modal LLMs

  • Cross-Attention
  • Vision-Language Pre-training (VLP)
  • Contrastive Learning (e.g., CLIP)
  • Modality Alignment
  • Vector Quantization

Fine-Tuning

  • Parameter-Efficient Fine-Tuning (PEFT)
  • Low-Rank Adaptation (LoRA)
  • Quantized LoRA (QLoRA)
  • Reinforcement Learning from Human Feedback (RLHF)
  • Direct Preference Optimization (DPO)
  • Supervised Fine-Tuning (SFT)

Applications & RAG (Retrieval-Augmented Generation) Patterns

  • Vector Embeddings
  • Cosine Similarity
  • Approximate Nearest Neighbor (ANN)
  • Dense Retrieval
  • Hybrid Search (Lexical + Semantic)
  • Re-ranking Models (Cross-Encoders)
  • Context Window Constraints
  • Query Transformation

Agents & MCP (Model Context Protocol)

  • ReAct Framework (Reasoning and Acting)
  • Tool Calling / Function Calling
  • Autonomous Agents
  • Chain-of-Thought (CoT)
  • Model Context Protocol (MCP)
  • State Machine Routing

Ethics in AI

  • Algorithmic Bias
  • Differential Privacy
  • Alignment Problem
  • Data Provenance
  • Hallucination Mitigation
  • Toxicity Scoring

Thank you to all the speakers and staff at RRU.

Dr. Ravi Sheth | LinkedIn School of Information Technology, Artificial Intelligence and Cyber Security (SITAICS): Overview | LinkedIn Gujarat Council on Science and Technology (GUJCOST) | LinkedIn Government of Gujarat: Overview | LinkedIn Rashtriya Raksha University: Overview | LinkedIn Ankita Kapadia | LinkedIn Ankush Chander | LinkedIn Sandip Modha | LinkedIn Bhavesh Patel | LinkedIn Dr. Nikunj Tahilramani | LinkedIn Pragnesh Prajapati | LinkedIn Nirali Khoda | LinkedIn Rajesh Gupta | LinkedIn Mayur Makwana | LinkedIn Dr. Chandresh Parekh | LinkedIn

#ArtificialIntelligence #GenerativeAI #LLM #MachineLearning #DataScience #RAG #AIAgents #MCP #ResponsibleAI #GeoAI #DeepLearning #Research #HigherEducation #EnterpriseAI #FutureOfWork

Concept Credit: Neil Harwani (Article) & Rashtriya Raksha University (FDP / Short term course)

Creation Help: ChatGPT, XMind and Gemini

📢 Stay informed:

🚕 From Traffic Prediction to Decision Intelligence — A Graph ML Story

Below are insights from my open book assignment / exam at IIT GNX converted into a blog-based story with help on AI/GenAI. This was the most exciting open book assignment / exam given by me till now. Open to comments, suggestions, ideas, debates, improvements, corrections, reviews, etc. Feel free to email me (refer contact detail in the bottom of this article) or message me on LinkedIn.

📌 The Real Question Isn’t Prediction — It’s Decision

Most data science projects stop at:

“Model accuracy improved.”

But in real systems—especially ride-hailing, logistics, BFSI, or infra platforms—that’s not enough.

The real question is:

What decision becomes better because of this model?

This assignment pushed me to think differently.

Instead of just predicting traffic, I asked:

How can traffic forecasts drive real operational decisions in a ride-hailing system?


🧠 Problem Framing (What Actually Matters)

We used the METR-LA dataset:

  • 207 traffic sensors
  • 5-minute interval readings
  • ~4 months of data
  • Objective: predict traffic speeds 5, 15, 30 minutes ahead

But here’s the twist:

👉 Each sensor is not independent 👉 Roads are connected systems 👉 Congestion spreads like a graph

So instead of treating data as rows in a table…

We treat it as a graph system


🌐 Thinking in Graphs (Systems Thinking)

  • Nodes → Traffic sensors
  • Edges → Road proximity / connectivity
  • Signals → Speed over time

This is where complex systems + spatial thinking come into play.

Traffic ≠ isolated events Traffic = propagating behavior across a network


📊 What the Data Told Us

From exploratory analysis:

  • Congestion appears in clusters (not random points)
  • Patterns repeat during commute peaks
  • Slowdowns are both: Temporal (time-based) Spatial (location-based)

👉 This is critical insight for operations:

  • Time tells you when to act
  • Space tells you where to act

🤖 Models We Tested (Keep It Honest)

To make this real (not overhyped), we compared:

1. Persistence Model

  • “Tomorrow ≈ Today”
  • Surprisingly strong for 5-minute prediction

2. Random Forest

  • Uses past lag features
  • Captures non-linear temporal patterns

3. Graph ML Model (GConvGRU)

  • Combines: Graph Convolution → spatial relationships GRU → temporal dynamics

📈 Results (Where Graph ML Actually Matters)

From the results:

Horizon Best Insight (Labels)

5 min Simple models work well

15 min Graph ML starts winning

30 min Graph ML clearly better

👉 Why?

Because:

Short-term = inertia Medium-term = propagation

Graph models capture how congestion spreads, not just how it exists.


🚕 Turning Predictions into Decisions

This is where the project becomes real.

🔴 If congestion is predicted in next 15–30 mins:

  • Reduce driver inflow into that corridor
  • Increase ETA buffers
  • Trigger incentives in nearby zones

🟢 What this enables:

  • Better ETA reliability
  • Smarter driver utilization
  • Reduced customer wait time
  • Proactive—not reactive—operations

🧩 The Big Shift: Model → Decision System

This project is NOT just:

“Train model → predict → done”

It is:

EDA → Model → Evaluation → Business Rules → Decision Intelligence

The work is framed as a decision-intelligence exercise rather than only model-building


⚠️ Reality Check (Limitations)

Let’s stay grounded.

The dataset does NOT include:

  • Ride demand
  • Driver availability
  • Weather
  • Events
  • Airport queues

So:

This is traffic intelligence, not full business optimization


🔧 What I Learned (Real Engineering Insights)

From my own notes:

  • Training time is real (hours, not minutes)
  • GPU/TPU selection matters
  • Early stopping is critical (overfitting is silent killer)
  • Graph ML pipelines are non-trivial systems
  • LLMs can accelerate development—but thinking is still yours

🏗️ Architecture Thinking (My Take)

What excites me most is not the model.

It’s the system design potential:

Imagine combining this with:

  • Real-time driver GPS
  • Demand prediction models
  • Event/weather APIs
  • Reinforcement learning for dispatch

👉 You get:

Autonomous Decision Systems for Urban Mobility


🔮 Where This Connects to My Larger Work

This directly aligns with what I’m exploring:

Agentic AI + Graph Systems + Probabilistic Models for Autonomous Debugging & Decision Systems

Traffic is just one domain.

Same thinking applies to:

  • Microservices failures
  • Network congestion
  • Financial risk propagation
  • Supply chain disruptions

🧠 Final Thought

A staff engineer once asked:

“What gets harder after this lands?”

For me, this project answered a deeper question:

What gets smarter after this lands?


📌 Bottom Line

  • Graph ML is not just “better ML”
  • It is better system understanding
  • Real value comes when: Predictions → Decisions Models → Actions Data → Intelligence

📢 Stay informed:


#GraphML #DataScience #AI #SpatialDataScience #RideHailing #DecisionIntelligence #SystemsThinking #GNN #MachineLearning #TechLeadership

Dimensions for Artificial Intelligence / GenAI / LLMs / Deep Learning / Neural Networks / Data Science to ponder on – Part 1-Assisted by AI – ChatGPT


🧠 1. Model Performance & Quality

Beyond accuracy:

  • Precision / Recall / F1-score
  • ROC-AUC
  • Calibration (probability correctness)
  • Generalization ability
  • Robustness (noise, adversarial inputs)
  • Stability (variance across runs)
  • Overfitting / Underfitting control
  • Latency (response time)
  • Throughput (requests per second)

⚖️ 2. Responsible AI / Ethics

Along with fairness, bias, explainability, interpretability:

  • Accountability
  • Transparency
  • Non-discrimination
  • Inclusiveness
  • Human oversight / Human-in-the-loop
  • Ethical alignment
  • Value alignment (especially for LLMs)
  • Safety (harm prevention)

🔐 3. Security & Privacy

Critical for enterprise and GenAI:

  • Data privacy (PII protection)
  • Differential privacy
  • Federated learning capability
  • Model security (model theft, extraction)
  • Prompt injection resistance (LLMs)
  • Data leakage prevention
  • Adversarial robustness
  • Access control & authentication

📊 4. Data Quality & Governance

Often more important than model itself:

  • Data completeness
  • Data consistency
  • Data lineage
  • Data drift detection
  • Concept drift detection
  • Bias in training data
  • Data freshness
  • Label quality
  • Auditability

⚙️ 5. Model Lifecycle & MLOps

Operational excellence:

  • Reproducibility
  • Versioning (data + model)
  • Monitoring (real-time + batch)
  • Model retraining strategy
  • Deployment reliability
  • Rollback capability
  • CI/CD for ML pipelines
  • Observability (logs, metrics, traces)

🧩 6. LLM / GenAI Specific Parameters

Very important for your GenAI work:

  • Hallucination rate
  • Faithfulness (groundedness to source)
  • Context retention (long context handling)
  • Instruction following
  • Toxicity / harmful output control
  • Prompt sensitivity
  • Response consistency
  • Token efficiency (cost optimization)
  • Alignment with system prompts / policies
  • Retrieval quality (RAG precision/recall)

🧪 7. Evaluation & Testing

For enterprise-grade systems:

  • Benchmarking (standard datasets)
  • Stress testing
  • Edge case coverage
  • Scenario testing
  • A/B testing
  • Human evaluation (subjective scoring)
  • Red teaming (especially for GenAI)

🌐 8. Business & Product Metrics

Often ignored in technical discussions:

  • ROI / Cost-benefit
  • User satisfaction
  • Adoption rate
  • Time saved / productivity gain
  • Decision impact quality
  • Revenue impact
  • Risk reduction

🧭 9. Governance & Compliance

Especially relevant in India (DPDP Act etc.):

  • Regulatory compliance
  • Audit trails
  • Model documentation (Model Cards)
  • Explainability for regulators
  • Consent management
  • Data residency

🧠 Quick Memory Framework

You can compress everything into:

👉 FAPES-DLMGB

  • Fairness & Ethics
  • Accuracy & Performance
  • Privacy & Security
  • Explainability
  • Scalability & Stability
  • Data Quality
  • Lifecycle (MLOps)
  • Monitoring
  • Governance
  • Business Impact

Reference frameworks:

  • NIST AI Risk Management Framework
  • ISO/IEC 42001

Note: Enhanced / compiled with help of AI / LLMs

PartyRock.aws apps – Part 1

Here is a list of my experimentation with PartyRock@AWS since last 2 days. It seems like an amazing platform. Try out the 11 apps and do provide feedback. What is nice is that it creates apps with widgets and various flows using only one line of description.

https://partyrock.aws/u/neil-hsopc/8kdTd2eUX/ResearchMate

Welcome to the Research Methodology Assistant. This tool will help you explore and develop appropriate research methodologies for your field of study. Whether you’re working in natural sciences, mathematics, social sciences, or humanities, we’ll help you identify suitable approaches and discuss their implementation.

https://partyrock.aws/u/neil-hsopc/e3j8uV107/EngiChat

Welcome to the Engineering Explorer! This interactive tool helps you learn about and discuss various engineering disciplines, from civil to quantum engineering. Start by entering your engineering-related question or topic of interest, select a broad category, and receive detailed information followed by an interactive discussion.

https://partyrock.aws/u/neil-hsopc/o19Ul0xtV/CodeTalk

Welcome to the Programming Languages Discussion Assistant! This tool helps you learn about different programming languages, get explanations of concepts, and see example code. Start by entering the programming language you want to discuss, then ask specific questions or request examples.

https://partyrock.aws/u/neil-hsopc/3bCf86mab/TechIntelligence-Nexus

Welcome to the AI Technology Explorer! This interactive assistant helps you explore and understand cutting-edge technologies in artificial intelligence, quantum computing, and cybersecurity. Simply select your area of interest and ask specific questions to begin an in-depth discussion.

https://partyrock.aws/u/neil-hsopc/hXEGkurZE/Globetrotter’s-Palette

Welcome to the Global Cultural Explorer! Here you can discover and learn about movies, music, places, and cultural traditions from around the world. Start by entering what interests you and selecting a category.

https://partyrock.aws/u/neil-hsopc/JnXSYu7VX/TechLeadChat

Welcome to the Tech & Management Discussion Assistant. This tool helps you explore and discuss topics related to technology and management. Start by entering your topic or question, select the primary focus area, and the AI will provide relevant context before engaging in a detailed discussion.

https://partyrock.aws/u/neil-hsopc/VZpGXXRo7/ScienceSync

Welcome to the Science Explorer! This interactive tool helps you learn about various scientific fields including Physics, Chemistry, and Biology. Choose your field of interest and ask specific questions to get detailed explanations. You can also engage in an interactive discussion about any scientific topic.

https://partyrock.aws/u/neil-hsopc/deJPerhon/TruthSift

Welcome to the Fact Checker Assistant. This tool helps you analyze claims and statements to determine their accuracy using reliable sources and AI-powered analysis. Start by entering a claim you’d like to fact-check, optionally upload supporting documents, and get a detailed analysis.

https://partyrock.aws/u/neil-hsopc/YDhulASn9/MathViz

Welcome to the Mathematics Visualization Assistant! This tool helps you explore mathematical concepts through discussion and visual representation. Enter your mathematical question or concept below, and I’ll help you understand it through explanations, discussions, and visual aids.

https://partyrock.aws/u/neil-hsopc/He7Rk5gJs/WikiGPT-Insights

Enter a topic to explore Wikipedia content and analyze it using AI. The assistant will help you understand the content better and answer any questions you have about the topic.

https://partyrock.aws/u/neil-hsopc/A-Tqrcto8/ForensiScan

Welcome to the Cyber Forensics Analysis Tool. This tool helps you analyze files for potential security threats, malware signatures, metadata anomalies, and hidden content. Upload your file and select the type of analysis you’d like to perform.

Keywords (Glossary) for Generative AI – Part 1

Here are some important keywords in the ecosystem of Generative AI – Part 1:

  • Transformers
  • Natural language prompts
  • Large language models
  • ChatGPT
  • Bing Chat
  • Bard
  • LLaMA
  • Stable Diffusion
  • Midjourney
  • DALL-E
  • GPT
  • LAMDA
  • BLOOM
  • GitHub Co-pilot
  • NVidia
  • AMD
  • PaLM
  • DeepFakes
  • OpenAI
  • Bias
  • Hallucination

References:

What points can be part of fair use disclaimer for Generative AI? – Part 1

As per me, 0.1 version (draft) for What points can be part of fair use disclaimer for Generative AI? – Part 1 would be:

  • Reference that it was taken from GAI
  • Prompt/s and prompt sequence used for the solution.
  • Which GAI system was used?
  • Was it real time or non-real time GAI?
  • Was the information verified before posting from GAI?
  • Date-time stamp
  • References provided by GAI
  • Any copyright / legal / intellectual property / patents or other disclosures?
  • Any other points that you could point me to?

Email me at: Neil@HarwaniSystems.in