Implementation:Ucbepic Docetl MOAR ParetoFrontier
| Knowledge Sources | |
|---|---|
| Domains | Data_Processing, Optimization, Multi_Objective_Optimization |
| Last Updated | 2026-02-08 00:00 GMT |
Overview
Concrete tool for managing a Pareto frontier of cost-accuracy tradeoffs during MCTS-based pipeline optimization provided by DocETL.
Description
The ParetoFrontier class maintains a collection of pipeline plans (represented as Node objects), estimates their accuracy through evaluation functions or pairwise comparisons, and constructs a Pareto frontier over the cost-accuracy space. It provides hypervolume-based frontier updates, distance calculations for reward signals, and integrates with the MCTS algorithm by supplying value estimates for backpropagation. The class also generates summary statistics and visualization plots of the frontier.
Usage
Use this class within the MOAR optimizer to track and manage the set of non-dominated pipeline configurations discovered during search. It serves as the reward mechanism that guides the MCTS exploration toward Pareto-optimal solutions.
Code Reference
Source Location
- Repository: Ucbepic_Docetl
- File: docetl/moar/ParetoFrontier.py
- Lines: 1-425
Signature
class ParetoFrontier:
def __init__(
self,
action_rewards: Dict[str, float],
action_cost_changes: Dict[str, float],
action_accuracy_changes: Dict[str, float],
dataset_name: str,
evaluate_func: Callable[[str], Dict[str, Any]],
console=None,
): ...
def add_plan(self, node: Node) -> Dict[Node, int]: ...
def add_plan_f1(self, node: Node, accuracy: float) -> Tuple[Dict[Node, int], bool]: ...
def get_all_plans_summary(self) -> List[Dict[str, Any]]: ...
Import
from docetl.moar.ParetoFrontier import ParetoFrontier
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| action_rewards | Dict[str, float] | Yes | Reference to MCTS action rewards dictionary for tracking |
| action_cost_changes | Dict[str, float] | Yes | Reference to MCTS action cost changes dictionary |
| action_accuracy_changes | Dict[str, float] | Yes | Reference to MCTS action accuracy changes dictionary |
| dataset_name | str | Yes | Name of the dataset being optimized (maps to a primary metric) |
| evaluate_func | Callable[[str], Dict[str, Any]] | Yes | Evaluation function taking a results file path and returning metrics |
| console | object | No | Console instance for logging (defaults to DOCETL_CONSOLE) |
Outputs
| Name | Type | Description |
|---|---|---|
| affected_nodes | Dict[Node, int] | Mapping of nodes affected by frontier updates with their status |
| is_frontier_updated | bool | Whether the Pareto frontier was changed by adding a new plan |
| plans_summary | List[Dict[str, Any]] | Summary of all plans with cost, accuracy, and value metrics |
Usage Examples
from docetl.moar.ParetoFrontier import ParetoFrontier
from docetl.moar.Node import Node
# Initialize the Pareto frontier
frontier = ParetoFrontier(
action_rewards={},
action_cost_changes={},
action_accuracy_changes={},
dataset_name="cuad",
evaluate_func=lambda path: {"avg_f1": 0.85},
)
# Add a plan with pre-evaluated accuracy
node = Node(yaml_file_path="optimized_pipeline.yaml")
node.cost = 2.50
affected, updated = frontier.add_plan_f1(node, accuracy=0.85)
# Get summary of all plans
summary = frontier.get_all_plans_summary()
for plan in summary:
print(f"Node {plan['node']}: cost={plan['cost']}, accuracy={plan['accuracy']}")