cpp: more updates to transformer