liveBook · Manning

P

As explained in How Large Language Models Work

P is the complexity class of problems solvable by deterministic algorithms in polynomial time.

P is the complexity class containing problems solvable by deterministic algorithms in polynomial time. Complexity asks how computation time grows as input size increases; Big-O notation describes that growth. section 7.4

Polynomial-time does not mean instantly or cheaply for every input. It distinguishes comparatively manageable growth from exponential growth, which can make exact solutions impractical as inputs expand. section 7.4

The surrounding complexity examples show the contrast:

  • Linear programming is listed with O(n³) complexity, a polynomial-time example. section 7.4
  • Prime factorization, traveling salesman, and integer programming are listed with exponential complexity, illustrating harder growth. section 7.4
Figure 7.7 A Venn diagram of computational complexities (assuming \(P \neq NP\), a minor point for the nerds) relate to each other. The top arrows give examples of the kind of problem that a new complexity class lets you solve. The bottom arrows show where LLMs land in terms of their complexity.
figure

Use the complexity-class diagram to place P beside related classes and compare those classes with LLM computation. section 7.4

How How Large Language Models Work covers it

How deep it goes
Defines complexity through input-size growth and contrasts polynomial with exponential behavior, without deriving formal class boundaries.
Examples
Uses linear programming, prime factorization, traveling salesman, and integer programming to contrast polynomial and exponential complexity.
What it assumes
Starts from intuitive input-size and runtime comparisons before introducing Big-O notation and complexity classes.
What you can do after
Evaluate claims about computational capability by relating problems to input growth and complexity class.
How it connects
Connects P with algorithmic complexity, Big-O notation, NP, and LLMs.

Also explained in

Compare how 2 books explain p →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of How Large Language Models Work. The section links point to the parts of the book it draws on.