private ExpressionNode transformTokenTypeIds(ReferenceNode feature, RankProfileTransformContext context) {
        checkReferenceArguments(feature, 1);

        TensorType type = createTensorType(feature.getName(), feature.getArguments().expressions().get(0));

        // we need to add functions calculating the token lengths of the arguments
        createTokenLengthFunctions(feature, context, 1);

        List<ExpressionNode> tokenSequence = createTokenSequence(feature, CLS, SEP, 1);
        ExpressionNode queryLengthExpr = createLengthExpr(2, tokenSequence);
        ExpressionNode restLengthExpr = createLengthExpr(tokenSequence.size() - 1, tokenSequence);
        ExpressionNode expr = new IfNode(
                new OperationNode(new ReferenceNode("d1"), Operator.smaller, queryLengthExpr),
                ZERO,
                new IfNode(
                        new OperationNode(new ReferenceNode("d1"), Operator.smaller, restLengthExpr),
                        ONE,
                        ZERO
                )
        );
        return new TensorFunctionNode(Generate.bound(type, wrapScalar(expr)));
    }
Transforms a feature of the form

    tokenTypeIds(128, a, b, ...)

to an expression that generates a tensor that has values 0 for "a"
(including CLS and SEP tokens) and 1 for the rest of the sequence.

Concretely, transforms to a tensor generation expression:

    tensor(d0[1],d1[128])(
        if (d1 < 1 + length_a + 1,
            0,
            if (d1 < 1 + length_a + 1 + length_b + 1 + ...,
                1,
                0
        )))
config-model/src/main/java/com/yahoo/schema/expressiontransforms/TokenTransformer.java