1. Home
  2. Explore
  3. Computer Science
  4. Machine Learning Overview

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Machine Learning Overview

  • 23Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Search Problem Fundamentals

What does the Bitter Lesson by Rich Sutton argue about AI methods?

23 questions

  1. 1

    What does the Bitter Lesson by Rich Sutton argue about AI methods?

    1. A

      Handcrafted prior knowledge is essential for effective AI systems.

    2. B

      Symbolic AI approaches like search have been rendered obsolete by modern machine learning.

    3. C

      Deep learning alone is sufficient for all AI problems without needing search.

    4. D

      General methods that leverage computation are ultimately the most effective by a large margin.

    Correct answer
    D

    General methods that leverage computation are ultimately the most effective by a large margin.

    Explanation

    The Bitter Lesson argues that general methods scaling with compute, such as search and learning, are most effective, not handcrafted priors.

  2. 2

    What are the three key components of a search problem?

    1. A

      Start state, successors function, and is_end function

    2. B

      Input, output, and training data

    3. C

      Agent, environment, and policy

    4. D

      States, actions, and rewards

    Correct answer
    A

    Start state, successors function, and is_end function

    Explanation

    A search problem is defined by a start state, a successors function returning possible steps (action, cost, next state), and an is_end function to check termination.

  3. 3

    In the travel search problem, what are the actions available from block i?

    1. A

      Take tram to i+1 costing 1 minute, or walk to 2*i costing 2 minutes

    2. B

      Walk to i+1 costing 1 minute, or take tram to 2*i costing 2 minutes

    3. C

      Walk to i+1 costing 2 minutes, or take tram to 2*i costing 1 minute

    4. D

      Walk to i-1 costing 1 minute, or take tram to i/2 costing 2 minutes

    Correct answer
    B

    Walk to i+1 costing 1 minute, or take tram to 2*i costing 2 minutes

    Explanation

    From block i, walking to i+1 costs 1 minute, and taking the tram to 2i costs 2 minutes, provided i+1 ≤ n and 2i ≤ n.

  4. 4

    What information must a state contain in a search problem?

    1. A

      Only the current location

    2. B

      The total cost incurred so far

    3. C

      The entire history of all visited states

    4. D

      Any information needed to evaluate future actions, costs, and successors

    Correct answer
    D

    Any information needed to evaluate future actions, costs, and successors

    Explanation

    A state must contain all relevant information to determine future actions, costs, and successors, such as location, tickets, or last action.

  5. 5

    To enforce a constraint that the tram cannot be taken twice in a row, what additional field should the state include?

    1. A

      The total number of steps taken

    2. B

      The current location modulo 2

    3. C

      The number of tickets remaining

    4. D

      Whether the last action was taking the tram

    Correct answer
    D

    Whether the last action was taking the tram

    Explanation

    To prevent two consecutive tram rides, the state must record whether the last action was a tram ride, so that the successor function can exclude tram if it was.

  6. 6

    What is the future cost of a state?

    1. A

      The minimum total cost from that state to any end state

    2. B

      The expected cost of a random rollout from that state

    3. C

      The cost of the cheapest action from that state

    4. D

      The number of steps needed to reach an end state

    Correct answer
    A

    The minimum total cost from that state to any end state

    Explanation

    Future cost of a state is the cost of the minimum-cost solution from that state to an end state, defined recursively via the recurrence.

  7. 7

    What is the recurrence for future cost in exhaustive search?

    1. A

      future_cost(S) = min over successors (cost(action) + future_cost(S'))

    2. B

      future_cost(S) = cost(action) + future_cost(S') for the first action

    3. C

      future_cost(S) = max over successors (cost(action) + future_cost(S'))

    4. D

      future_cost(S) = sum over successors (cost(action) + future_cost(S'))

    Correct answer
    A

    future_cost(S) = min over successors (cost(action) + future_cost(S'))

    Explanation

    The future cost is the minimum over all possible successors of the immediate action cost plus the future cost from the resulting state.

  8. 8

    What are the time and memory complexities of exhaustive search in terms of the state space?

    1. A

      Time: quadratic in number of states; Memory: linear in number of states

    2. B

      Time: linear in number of states; Memory: exponential in solution length

    3. C

      Time: exponential in number of states; Memory: linear in solution length

    4. D

      Time: exponential in solution length; Memory: exponential in number of states

    Correct answer
    C

    Time: exponential in number of states; Memory: linear in solution length

    Explanation

    Exhaustive search explores all paths, leading to exponential time, but memory is linear in the depth of recursion (solution length).

  9. 9

    Why can exhaustive search fail to terminate in graphs with cycles?

    1. A

      Because the recursion depth may exceed the maximum call stack size

    2. B

      Because cycles create infinite paths with no end state

    3. C

      Because the future cost recurrence becomes undefined

    4. D

      Because the algorithm never visits the same state twice

    Correct answer
    B

    Because cycles create infinite paths with no end state

    Explanation

    If cycles exist, the search may loop infinitely, never reaching an end state, unless a step limit or cycle detection is added.

  10. 10

    How does dynamic programming improve upon exhaustive search?

    1. A

      By randomly sampling actions to reduce the search space

    2. B

      By using a cache to avoid recomputing future cost for states already visited

    3. C

      By using a heuristic to guide the order of exploration

    4. D

      By pruning actions with high cost during the search

    Correct answer
    B

    By using a cache to avoid recomputing future cost for states already visited

    Explanation

    Dynamic programming caches the future cost for each state, so each state is computed only once, reducing time to proportional to number of states.

  11. 11

    What is the time complexity of dynamic programming for solving a search problem?

    1. A

      Exponential in the number of states

    2. B

      Quadratic in the number of actions

    3. C

      Linear in the number of states

    4. D

      Linear in the solution length

    Correct answer
    C

    Linear in the number of states

    Explanation

    With caching, each state is computed exactly once, so time is O(number of states × average successors), which is typically linear in number of states.

  12. 12

    When is dynamic programming particularly advantageous over exhaustive search?

    1. A

      When the state space is very large and does not fit in memory

    2. B

      When there are many different paths leading to the same state

    3. C

      When the solution length is very short

    4. D

      When actions always lead to new, unique states

    Correct answer
    B

    When there are many different paths leading to the same state

    Explanation

    DP is useful when many paths converge to the same state, so caching avoids redundant computation. If all paths are unique, DP offers little benefit.

  13. 13

    What is a major limitation of dynamic programming?

    1. A

      It requires all action costs to be non-negative

    2. B

      It only works for problems with a single end state

    3. C

      It cannot handle cycles in the state graph

    4. D

      It needs to store solutions for all states, which may exceed memory

    Correct answer
    D

    It needs to store solutions for all states, which may exceed memory

    Explanation

    DP caches solutions for every state, requiring memory proportional to the number of states, which can be infeasible for large state spaces.

  14. 14

    What does the 'best of n' algorithm do?

    1. A

      It generates n random paths from start to end and selects the one with lowest cost

    2. B

      It keeps the n best partial solutions at each step and expands them iteratively

    3. C

      It runs n parallel exhaustive searches and returns the best overall solution

    4. D

      It uses a heuristic to compare n candidate actions and picks the best one

    Correct answer
    A

    It generates n random paths from start to end and selects the one with lowest cost

    Explanation

    Best of n performs n independent rollouts (random simulations) from start to end, then returns the solution with the lowest cost.

  15. 15

    What is a key advantage of best of n search?

    1. A

      It is embarrassingly parallelizable

    2. B

      It always produces deterministic results

    3. C

      It guarantees finding the optimal solution

    4. D

      It uses very little memory regardless of state space size

    Correct answer
    A

    It is embarrassingly parallelizable

    Explanation

    Each rollout is independent, so best of n can be easily parallelized across multiple machines without communication.

  16. 16

    How does beam search differ from best of n?

    1. A

      All of the above

    2. B

      Beam search explores paths sequentially rather than in parallel

    3. C

      Beam search is deterministic while best of n is stochastic

    4. D

      Beam search uses a beam width to keep multiple partial solutions at each step

    Correct answer
    A

    All of the above

    Explanation

    Beam search is deterministic (if ties are broken deterministically), it explores sequentially by expanding a set of candidates at each step, and it maintains a fixed number (beam width) of partial solutions.

  17. 17

    In beam search, what happens when the number of candidate solutions exceeds the beam width?

    1. A

      Random candidates are dropped to maintain the beam width

    2. B

      They are all kept but with lower priority

    3. C

      The beam width is increased to accommodate all candidates

    4. D

      The candidates are sorted by cost and only the top beam width are kept

    Correct answer
    D

    The candidates are sorted by cost and only the top beam width are kept

    Explanation

    At each step, all candidates are sorted by their total cost, and only the best beam width candidates are retained for the next iteration.

  18. 18

    What is beam search equivalent to when the beam width is 1?

    1. A

      Greedy search

    2. B

      Dynamic programming

    3. C

      Best of n with n=1

    4. D

      Exhaustive search

    Correct answer
    A

    Greedy search

    Explanation

    With beam width 1, only the single best partial solution is kept at each step, which is the greedy algorithm.

  19. 19

    In the context of language model search, what is the cost of an action?

    1. A

      The negative log probability of the next token

    2. B

      The probability of the next token

    3. C

      The number of tokens generated so far

    4. D

      The cross-entropy loss of the model

    Correct answer
    A

    The negative log probability of the next token

    Explanation

    To maximize probability, we minimize negative log probability. So the cost is defined as -log P(next token | context).

  20. 20

    In a language model search problem, what does the state represent?

    1. A

      The current token being predicted

    2. B

      The hidden state of the model

    3. C

      The prompt plus the prefix of the response generated so far

    4. D

      The entire sequence of tokens including the prompt

    Correct answer
    C

    The prompt plus the prefix of the response generated so far

    Explanation

    The state is a string containing the original prompt concatenated with the partial response generated so far.

  21. 21

    What is the purpose of a verifier in the language model search example?

    1. A

      To select the next token from the model's output distribution

    2. B

      To tokenize the input prompt

    3. C

      To compute the probability of a generated sequence

    4. D

      To check if a generated response is correct and provide a cost bonus

    Correct answer
    D

    To check if a generated response is correct and provide a cost bonus

    Explanation

    The verifier returns a Boolean indicating correctness, and if correct, a large negative cost bonus (e.g., -100) is added to favor that solution.

  22. 22

    How does best-of-n sampling relate to test-time compute in language models?

    1. A

      It caches intermediate computations to speed up generation

    2. B

      It reduces the number of parameters needed for inference

    3. C

      It generates multiple responses at inference time and selects the best one, using more compute to improve quality

    4. D

      It trains the model to predict multiple tokens at once

    Correct answer
    C

    It generates multiple responses at inference time and selects the best one, using more compute to improve quality

    Explanation

    Test-time compute refers to spending extra computation during inference to improve results; best-of-n is a simple method that does exactly that by sampling multiple responses.

  23. 23

    In the lecture, what was the solution for the travel problem with n=10 using best-of-n?

    1. A

      tram, tram, walk, walk (cost 7)

    2. B

      walk, walk, tram, tram (cost 7)

    3. C

      walk, walk, walk, walk, tram (cost 6)

    4. D

      walk, tram, walk, tram (cost 6)

    Correct answer
    D

    walk, tram, walk, tram (cost 6)

    Explanation

    The optimal solution found was walk, tram, walk, tram with total cost 6, verified by exhaustive search and dynamic programming.

Question 1 of 23
Question 1 of 23

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent