FLEX separates feature specification from reward optimization. Language corrections specify which features matter, and demonstrations then set how much each feature matters. The robot models reward as a linear combination of features, \( R_\theta(\tau) = \theta^\top \Phi(\tau) \), and learns the weights \( \theta \) from demonstrations with maximum-entropy IRL.
At each iteration \( k \), the robot executes its best trajectory under its current feature set \( \Phi^k \). The human compares it to the behavior they wanted and gives a language correction \( \ell^k \). A language model approximates the updated feature set, \( \Phi^{k+1} \approx f_{\text{LM}}(\Phi^k, \ell^k) \), by applying three operations in sequence:
- ADD proposes a new feature and generates code to compute it if the current set does not explain the correction, so that \( \Phi' \supseteq \Phi \).
- GENERALIZE extracts the higher-level intent \( \omega \) behind the correction and broadens features to match (e.g., "laptop" → "electronic devices"), keeping \( |\Phi'| = |\Phi| \).
- MASK queries the LM once per feature to estimate a relevance score \( m_i \in \{0, 1\} \) and drops irrelevant features, so that \( \Phi' \subseteq \Phi \).
The order ADD → GENERALIZE → MASK reflects dependencies between the operations: new features are fully processed first, and masking decisions are made on features' final, generalized forms.