Piece-square table
Piece-square table
Definition
A piece-square table (PST) is a grid of numerical values, one per board square, for each piece type and color. Each number estimates how favorable it is for that specific piece to sit on that square, typically measured in centipawns (1 pawn = 100). Engines add these values into the evaluation to reward good piece placement (for example, knights in the center) and penalize poor placement (such as rooks blocked by their own pawns).
How it is used in chess
- In chess engines: PSTs are part of the evaluation function. For each piece on the board, the engine looks up its square’s PST value and sums them, alongside other terms like material, mobility, pawn structure, and king safety.
- Middlegame and endgame versions: Many engines maintain two PSTs per piece (middlegame and endgame) and blend them with “tapered evaluation,” increasing the weight of endgame PSTs as material comes off the board.
- Color mirroring: Because the board is symmetric, Black’s PST is often derived by mirroring White’s PST vertically (or by using sign flips), saving storage and simplifying implementation.
- Human understanding: PSTs encode classic heuristics: knights prefer central squares; bishops like long diagonals; rooks excel on open files and 7th rank; queens prefer activity but can be overexposed early; kings seek shelter in the middlegame but centralize in the endgame.
Strategic and historical significance
PSTs convert long-standing positional principles into numbers. They offer a fast, static way to score piece activity and square quality, which was crucial in early engines and remains useful today.
- Origins: The idea reflects classical strategy (centralization, open files, outposts) and dates back to the earliest evaluation functions inspired by Shannon’s 1950 paper proposing weighted positional features.
- Hand-tuning to data-driven: Early strong programs (e.g., Crafty, Fruit, Glaurung/early Stockfish) hand-tuned PSTs. Later, engines used statistical methods like Texel tuning or SPSA to learn PST values from large game databases or self-play.
- Modern era: Even with neural-eval approaches (e.g., NNUE), PST-like concepts persist. Many networks take as input “piece on square” features—essentially an expansive, learned version of PSTs—while classical PSTs are still excellent for educational tools and simpler engines.
- Strategic impact: PSTs encourage healthy habits: castle early because central king squares get penalized in the middlegame; push the king toward the center in endgames where central squares are rewarded; seek outposts for knights and 7th-rank invasion for rooks.
Examples
Example 1: Knight in the center vs. on the rim. Typical PSTs give a knight on d4 a bonus and a knight on a6 a penalty, reflecting the “A knight on the rim is dim” adage.
Interpretation: The knight on d4 controls eight or many key central squares and can jump either way; the knight on a6 has limited scope. A simple PST might give Nd4 +20 to +40 centipawns relative to corners, while Na6 might be −20 to −40 (illustrative values; exact numbers vary by engine).
Example 2: Castling and king safety in the middlegame. Engines often penalize a king stuck in the center and reward safe castling squares. In a Ruy Lopez start, castling improves the king’s PST score and complements other safety terms.
Interpretation: In the middlegame PSTs, central squares (e1/e8) tend to carry a noticeable penalty for the king, while g1/g8 (behind a pawn shield) fares better. In many hand-tuned sets, this swing can be on the order of a few tenths of a pawn when combined with other safety terms.
Example 3: Endgame king centralization. Once queens and most pieces are off, PSTs shift: central king squares are rewarded to promote activity and opposition.
Interpretation: Endgame PSTs typically add a positive bonus for the king on central squares (e4, d4, e5, d5) and less so on edges/corners, encouraging the winning technique of activating the king.
Interesting facts and anecdotes
- Classic rules in numbers: PSTs bake in sayings like “Knights love outposts,” “Rooks belong on open files,” and “A knight on the rim is dim.”
- Deep Blue-era evaluation: Even supercomputers like Deep Blue (Kasparov vs. Deep Blue, 1997) used large, feature-based evaluations with terms analogous to PSTs to guide their massive search.
- Two-phase tables: Many engines maintain separate middlegame and endgame PSTs and blend them smoothly with a phase factor. This “tapering” captures the plan shift from king shelter to king activity.
- Learned parameters: Modern tuning can discover non-intuitive bonuses, like subtle preferences for certain bishop squares in typical structures, improving results by a few Elo without human bias.
Practical tips
- For players: Use PST intuition to place pieces—centralize knights and kings (in endgames), put rooks on open files and the 7th rank, and keep your king safe in the middlegame.
- Beware exceptions: PSTs are static; tactics and concrete pawn structure can override them. A “bad” square may be best if it creates a decisive tactic or a blockade.
- For programmers: Store PSTs as arrays indexed by piece and square, in centipawns. Mirror for Black, maintain middlegame/endgame versions, and update incrementally on moves for speed. Consider Texel or SPSA tuning to optimize the numbers from data.