The generation algorithm can be improved somewhat further by the application of standard logic programming techniques. In  several optimizations for semantic-head-driven generation are described. For example, non-chain-rules with variable semantics (such rules may correspond to traces, or function words), are eliminated by a partial evaluation technique. Furthermore, a better indexing on semantic structures is described in order to have fast access to non-chain-rules, whereas chain-rules are indexed on their syntactic features.
Another possible improvement is discussed in ; they describe a variant of the semantic-head-driven generation algorithm in which the semantic head of a phrase is connected upward, but the generation of the daughters of each chain-rule is only performed once the head has been connected upward. This effect can be obtained by re-ordering the clauses of the sem_head predicate as follows:
Finally, note that defining the head-driven generator as a meta-interpreter may at first sight seem somewhat inefficient. However note that such a meta-interpreter can often be compiled away. In  such a compilation is described for a semantic-head-driven generator defined as a meta-interpreter in Prolog. The resulting program is very similar to the result of grammar compilation described in [18,16].