Skip to main content

Command Palette

Search for a command to run...

GEN AI Interview Question - PART 1

Updated
6 min readView as Markdown
  1. Explain AI , ML , DL and GEN AI ?

    AI -> AI is the broad field to build systems/machines to perform some specific task that normally require human intelligence

    ML-> A subset of AI , that enables machines to learn from data and improve with experiences without being explicitly programmed.

    DL -> A subest of ML , that uses multilayer nueral networks (deep nueral networks) to learn complex pattern from large amount of data)

    GEN AI -> GEN AI is a class of AI models, that is used to generate new content based on learned patterns.

  2. What is LLM ? How LLM works ( or What happen inside LLM when you ask que) ?
    LLM is the type of AI model that is trained on large amount of text data and can generate human like text.

    Working :
    1. User provide Text promt to LLM.
    2. This Text converted into tokens(smallest unit) and further then TokenIDs
    3. These TokenIDS converted into numerical vector called embeddings
    4. Model process these embedding in Transformer attention layer
    5. Model predict the next token
    6. Then generate the output

  3. What is Token and Tokenization ?
    Token is the smallest unit of text that a LLM can undertand.
    It can be any word , number , punctcation or even space.

    Tokenization is the process of conervting raw text into token and then further into token IDS.

  4. What is embeddings ?
    Embeddings are numerical vector represetation of data such as text.
    In RAG system emedings comverts text chunks into numerical vector that have semenetci meaning.
    ex: King queen -> cloasest in the high dimensional space , kept in one vector

  5. What is Transformer ? Self-attention ?
    Transformer is the arcitecture that is designed to process sequential data sucs as text . If follow mechenism called self attention which help transformer to find our the relationship betwenn the words or tokens in the input.
    Ex: The animal didnt cross the road cuz it was tired.
    To understand "it" the model need to connect it with "animal" -> selft attention help to findout these relations ship..
    ex: Money deposited in the bank.
    Self attention help model to undetrand this a money bank not a river bank.

  6. Prompt Enginnering ?
    Prompt engineering is the practice of designing a prompt(inputs) to get better and more accurate result.
    Good prompt : Clear instrcution + Relevent context + Proper constraint + Desired format
    Debug code promt: Write root cause + error message + component + expteced behavior + without changing unrelated code.

  7. What is RAG ? Why we need ? Explain RAG PipeLine ?
    RAG(Retrival Augmented Generation) is technique that combines the power of LLMs with external knowledge retrival to generate more accurate responses.
    Ex: HR chatbot -> only rely on document
    Need:
    - Provide up to date information
    - Reduce hallucination
    - Provide only domain specific information

    RAG PIPELINE:
    INDEXING PHASE
    1. Ingestion -> Load the data from various sources like pdf , doc
    2. Pre-Processing -> Clean , split , remove noisy data , normalise.
    3. Chunking -> Large document divided into smaller pieces called chunks.
    4. Embeddings-> These chunks are converted into the numerical vectors called embeddings.
    5. Store -> These embeddings are stored in a vector database such as Pinecone.

    QUERY PHASE: user ask any question -> that is also converted into embedding
    (pass that que to model to rewrtie the query -> advacne handling)
    1. Retrive -> It retrive top k chunks that is most similar to the question
    2. Augmentation -> Now retreived chunks are sent to the LLM as a context
    3. Genarte-> LLM generate final output based on retrived context.

  8. Fine Tuning ? Fine Tuning Vs RAG
    FIne Tuning is the process of taking a pre-trained LLM , and training it further on specific dataset so that it perform better for some particular task or domain.
    RAG Vs Fine Tuning
    Rag -> Doesn't change the model -> Good for private/current information Fine Tuning -> Changes the model's parameters -> Good for style, behavior, specialized tasks
    Ex: HR chatbot -> WHat is new leave policy ?
    RAG -> The system retrieves the latest leave policy document and gives it to the LLM.
    Fine tuning -> You train the model on thousands of HR conversations so it learns how an HR assistant should respond

  9. AI AGENTS ? Workflow ? Normal chatbot Vs Ai Agent ?
    Ai Agents are the AI systems that can undertsand the goal , make decsions , use tools and take action to achieve the goal with minimal human intervention.
    Workflow: Observe -> Think -> Plan -> Act -> Learn -> Repeat unitil the goal is achived.
    Chatbot vs AI AGents:
    Normal chatbot doesnt take the actions it only suggest the way to do that task. But AI agent can do everything itseld:
    ExMple: Book flight ticket from delhi to mumbai
    Normal chatbot -> tells visit this website and book the ticket
    Ai agent -> goes to that webiste , compare prices ,, ask for payment cofirmation and book ticket

  10. What is Langchain ? Langchain vs LangGraph ?
    Langhchain is the framerwork that provide tools and components that help to us to connect our LLM with external data , APIs , and databases to build AI Applications.

  11. What is Context Window ?
    The context window is the maximum amount of information an LLM can process at one time while generating a response.

    It includes things like:
    Your current question
    Previous conversation/messages
    System instructions Documents
    RAG context
    The model's generated output (depending on the model/API)

  12. Vector Vs Normal Databases ?
    Normal DB -> In Normal Databases , we searches strcutured data using exact conditions
    Vector DB -> Seraches based on semenetic meanings (generally used with ai applications)

    Ex: Someone seraches on Amazon : I want comfortable shoes for Jogging
    Normal DB: Doesnt process the whole sentence , it only process one keyword like shoes or jogging so it might be shows all the shoes.
    Vector DB: Undertsand every word and shows return most similar information.