Sub topic 13
CatBoost: Symmetric Trees
This chapter assumes you know how a decision tree splits data, how gradient boosting adds trees one at a time, and the basic LightGBM parameters such as num_leaves. It covers the tree shape CatBoost uses by default, why that shape is useful, and where it can hurt.
What a symmetric tree is
An ordinary decision tree chooses a split separately for every node. The left child of the root might split on age, while the right child splits on plan. LightGBM works this way, and so does scikit-learn's DecisionTreeRegressor.
A symmetric tree, which CatBoost also calls an oblivious tree, uses one rule per level. Every node at depth 1 applies the same feature and threshold. Every node at depth 2 applies the same feature and threshold, and so on. A tree of depth d therefore has exactly d splitting rules and 2^d leaves.
For example, a depth-3 tree might use these three rules:
plan == "pro"(a categorical split, on CatBoost's encoded value)age > 55city_encoded > 0.4
Each row answers three yes/no questions. The three answers form a 3-bit number, and that number is the leaf index, from 0 to 7.
How CatBoost builds one
At each level, CatBoost considers candidate splits. These are pairs of a feature and a threshold, and the thresholds come from quantized feature values, as in LightGBM's histograms. For each candidate it computes a score over all current leaves at once. It then picks the single split with the best total score and applies it to every leaf.
Compare this with leaf-wise growth in LightGBM. LightGBM picks the one leaf with the largest gain and splits only that leaf. CatBoost splits every leaf on the same rule. The shape is fixed by depth, not by a leaf budget.
Why this shape helps
Regularization
A symmetric tree has far fewer free choices. A depth-6 tree has 6 rules and 64 leaves. A fully free tree of the same depth could have 63 separate rules. The constraint limits how closely one tree can fit noise, which acts as a built-in regularizer. This is one reason CatBoost often performs well with default settings.
Fast prediction
Prediction needs no tree traversal with branching. CatBoost evaluates the d rules, packs the results into a bit index, and reads the leaf value from an array. The work is the same for every row and the memory access pattern is predictable. CatBoost's documentation describes this as a major reason its applier is fast, especially for low-latency serving.
Compact models
Because each level stores one rule, the model stores d rules plus 2^d leaf values per tree, not a full node structure.
Where it can hurt
- Weak local structure. A free tree can use
agein one branch andplanin another. A symmetric tree must use one rule for the whole level. If different regions of the data need different features, you need more depth or more trees to capture it. - Exponential leaf count. Leaves grow as
2^depth. Depth 10 gives 1024 leaves per tree, and many may hold few rows. CatBoost's default depth is 6, and the documentation allows values up to 16 for the default tree type, but large depths are slow and memory-hungry and overfit more easily. - Different tuning knobs.
num_leavesdoes not exist for symmetric trees. You tunedepthinstead, and the leaf count follows from it.
Changing the tree type
The grow_policy parameter selects the tree shape.
| `grow_policy` | Tree shape | Main size control |
|---|---|---|
| `SymmetricTree` (default) | One rule per level | `depth` |
| `Depthwise` | Free splits, level by level | `depth`, `min_data_in_leaf` |
| `Lossguide` | Free splits, best leaf first, like LightGBM | `max_leaves`, `min_data_in_leaf` |
min_data_in_leaf and max_leaves apply only to Depthwise and Lossguide. CatBoost ignores them for symmetric trees, or raises an error in some versions, so check your installed version.
Comparing depths in code
The following script trains the same classifier with several depths and reports the best validation AUC and the number of iterations used. It uses the same synthetic data as the training chapter.
import numpy as np
import pandas as pd
from catboost import CatBoostClassifier, Pool
from sklearn.model_selection import train_test_split
rng = np.random.default_rng(0)
n = 5000
df = pd.DataFrame({
"age": rng.integers(18, 70, n),
"city": rng.choice(["A", "B", "C", "D"], n),
"plan": rng.choice(["free", "basic", "pro"], n),
})
signal = (df["plan"] == "pro") | (df["age"] > 55)
flip = rng.random(n) < 0.1
y = (signal ^ flip).astype(int)
X_train, X_valid, y_train, y_valid = train_test_split(
df, y, test_size=0.2, random_state=0
)
cat_features = ["city", "plan"]
train_pool = Pool(X_train, y_train, cat_features=cat_features)
valid_pool = Pool(X_valid, y_valid, cat_features=cat_features)
for depth in [2, 4, 6, 8]:
model = CatBoostClassifier(
iterations=1000,
learning_rate=0.1,
depth=depth,
grow_policy="SymmetricTree",
eval_metric="AUC",
verbose=0,
random_seed=0,
)
model.fit(train_pool, eval_set=valid_pool, early_stopping_rounds=50)
best_auc = model.get_best_score()["validation"]["AUC"]
print(depth, model.get_best_iteration(), round(best_auc, 4))This dataset has a simple rule (plan == "pro" or age > 55) plus 10% label noise. Expect shallow trees to do about as well as deep ones. Deeper trees tend to reach their best iteration sooner and then overfit, so early stopping ends them earlier. Exact numbers depend on your CatBoost version.
Practical guidance
- Start with the default
depth=6. Try 4 to 8 before anything else. - If validation scores rise as you add depth, also raise
l2_leaf_reg(default 3) to counter overfitting from the extra leaves. - If you need LightGBM-style trees, for example on very large datasets with complex interactions, try
grow_policy="Lossguide"withmax_leaves. Training speed and accuracy can both change, so compare on your validation set. - Symmetric trees pair naturally with SHAP.
shap.TreeExplainersupports CatBoost models, and the fixed structure does not change how you read the output.
Summary of trade-offs
| Property | Symmetric trees | Free-form trees |
|---|---|---|
| Rules per tree | `depth` | Up to leaves minus 1 |
| Overfitting risk | Lower | Higher |
| Prediction speed | Very fast, index lookup | Slower, branching |
| Fit to local patterns | Weaker | Stronger |
| Main size control | `depth` | Leaves, min data in leaf |
Exercise
A CatBoost model uses symmetric trees with depth 5. How many splitting rules and how many leaves does each tree have? A colleague says that setting num_leaves=20 will give each tree 20 leaves. What is wrong with that?
Show answer
Each tree has 5 splitting rules, one per level, and 2^5 = 32 leaves. num_leaves does not control symmetric trees, because the leaf count is fixed by depth at 2^depth. To get a different size you change depth, or you switch to grow_policy="Lossguide" and set max_leaves=20.
Exercise
Your validation AUC improves when you move from depth 6 to depth 8, but the gap between training and validation AUC also grows. Name two changes you could try next, and explain how each acts on the problem.
Show answer
Raise l2_leaf_reg to shrink leaf values and reduce the effect of leaves with few rows. Alternatively, lower learning_rate and rely on early stopping, or step back to depth 7. Each acts on overfitting: depth 8 gives 256 leaves per tree, many with few rows, so stronger regularization or less capacity limits how much noise the trees fit.