Topology-Guided Synonymous Semantic Generation
- TGSSG is a method that constructs class-specific textual prompt sets by integrating LLM-generated synonyms and descriptions with CLIP-space topological filtering, enhancing semantic alignment in zero-shot models.
- It employs a multi-step pipeline including synonym generation, entropy-based ambiguity assessment, and persistent homology to filter and compile comprehensive prompts for robust set-to-set alignment with visual inputs.
- Empirical evaluations within the CPE framework show that incorporating TGSSG results in measurable gains, with up to a 2% accuracy improvement over baseline methods.
Searching arXiv for the cited papers to ground the article and confirm metadata. {"query":"(Yin et al., 24 Aug 2025) Constrained Prompt Enhancement for Improving Zero-Shot Generalization of Vision-LLMs", "max_results": 5} Topology-Guided Synonymous Semantic Generation (TGSSG) is a text-side method for zero-shot vision-language modeling that constructs a class-specific set of textual prompts by combining large-language-model-generated synonyms and descriptions with CLIP-space topological filtering. In the Constrained Prompt Enhancement (CPE) framework, TGSSG is introduced to address incomplete semantic expression in textual prompts: for each category , it generates a synonymous semantic set , a description set , embeds the synonyms in CLIP text space, filters them through semantic ambiguity entropy and persistent homology analysis, and then forms a comprehensive textual prompt set for subsequent set-to-set alignment against visual prompt sets (Yin et al., 24 Aug 2025).
1. System role and problem setting
TGSSG appears as the front-end text module of CPE, whose broader objective is to improve zero-shot generalization of vision-LLMs such as CLIP by making both text prompts and visual inputs semantically richer and better constrained. On the text side, TGSSG generates and filters a comprehensive set of textual prompts for each class; on the vision side, Category-Agnostic Discriminative Region Selection (CADRS) selects a compact set of visual prompts by identifying discriminative regions with activation maps from a pre-trained vision model. The resulting textual set and visual set are then matched by either CPE-TTA or CPE-OT (Yin et al., 24 Aug 2025).
The motivating diagnosis is lexical variation. A single class label such as the standard zero-shot template “a photo of a ” often fails to cover the semantic manifold under which visually similar instances were encountered during web-scale pretraining. The CPE paper states that CLIP text embeddings of synonyms can be far apart while corresponding images are close, and that performance depends strongly on which synonym is chosen. TGSSG addresses this by replacing one prompt per class with a filtered prompt set that covers multiple names and descriptions of the same concept (Yin et al., 24 Aug 2025).
A common simplification is to describe TGSSG as synonym expansion. In the formulation used in CPE, that is incomplete. TGSSG is a constrained prompt-construction pipeline: synonym generation is followed by CLIP embedding, entropy-based ambiguity assessment, persistent-homology-based compactness analysis, and topology-aware pruning before prompt assembly.
2. Synonymous semantic generation with LLMs
For each class label , TGSSG queries an off-the-shelf LLM to produce a synonym list with the prompt:
“Tell me in five words or less what are some common ways of referring to ?”
The output is parsed into a class-specific synonym set
with configured maximum 0 and default 1. The prompt design is deliberately constrained: “five words or less” biases the model toward short names or aliases, while “common ways” biases it toward frequent or colloquial references rather than obscure terminology (Yin et al., 24 Aug 2025).
TGSSG also generates a description set
2
using a dataset-aware two-step prompting strategy following MPVR and AWT. The descriptions are intended to capture attributes relevant to the downstream benchmark, such as color, shape, brand, or behavior. This means that TGSSG does not merely enumerate alternative class names; it couples alternate naming with attribute-level textual enrichment (Yin et al., 24 Aug 2025).
After synonym filtering, the surviving synonyms 3 are combined with 4 through the template
5
For each 6 and 7, TGSSG forms
8
and encodes these strings with the CLIP text encoder to obtain the comprehensive textual prompt set
9
The operative object is therefore not a single text prototype but a class-conditional point set in CLIP text space (Yin et al., 24 Aug 2025).
3. Entropy and persistent homology as topological constraints
The “topology-guided” component of TGSSG is defined over the CLIP embeddings of the generated synonyms. For class 0, let
1
TGSSG first computes a per-synonym semantic ambiguity entropy
2
where 3 is the cosine-similarity distance between embeddings. In the paper’s interpretation, higher entropy indicates greater semantic ambiguity or deviation of a synonym relative to the rest of the class-specific synonym set (Yin et al., 24 Aug 2025).
This local criterion is then paired with a global topological criterion. TGSSG constructs a Vietoris–Rips complex over the point cloud 4 and computes persistent homology, tracking the birth and death of topological features over a filtration. The CPE paper compresses this analysis into a scalar persistence value 5, described as characterizing the topological compactness of the synonym set. If the synonym cloud is tight, the topology is relatively simple; if it is scattered or multimodal, the topology is more complex (Yin et al., 24 Aug 2025).
The final synonym filter is
6
where 7 is the mean persistence across classes. This criterion combines local deviation and class-level topological compactness. Synonyms with high ambiguity inside a topologically scattered class are more likely to be filtered out, while synonyms whose entropy–persistence product remains below the global average are retained (Yin et al., 24 Aug 2025).
A recurrent misunderstanding is that the method relies only on pairwise semantic similarity. In the published formulation, pairwise similarity is only one part of the mechanism; persistent homology is introduced precisely to incorporate global structure of the synonym embedding cloud rather than local distance alone.
4. Prompt-set realization and cross-modal alignment
After filtering, TGSSG outputs 8, a class-specific set of multiple prompt embeddings. This set is consumed directly by the two alignment procedures in CPE. In CPE-TTA, the average embedding of the prompt set,
9
is shifted by a learnable vector 0 to form a class prototype 1. Probabilities over classes are computed against visual views 2, the 3 views with the lowest entropy are selected, and one-step gradient descent updates the shift vector at test time (Yin et al., 24 Aug 2025).
In CPE-OT, the textual set and visual set are treated as discrete distributions. For class 4, the text-side distribution 5 is supported on embeddings in 6, the image-side distribution 7 is supported on embeddings in 8, and the cost matrix uses cosine distance. The resulting Kantorovich optimal transport problem yields an optimal coupling between textual and visual point clouds, allowing classification by set-to-set rather than point-to-point alignment (Yin et al., 24 Aug 2025).
TGSSG is therefore not only a prompt generator but a prompt-set constructor designed for downstream matching operators that assume multi-prototype class representations. This is methodologically important: the value of the textual topology is realized only because the downstream inference procedures preserve set structure instead of collapsing all prompts to a single handcrafted text string.
5. Empirical characteristics and measured effect
The CPE experiments evaluate the full system on 10 image classification benchmarks. On average accuracy, the CLIP baseline records 9, AWT records 0, and CPE-OT reaches 1, which the paper reports as 2 over AWT and 3 over CLIP. Because CPE includes both TGSSG and CADRS, the ablation studies are the primary evidence for TGSSG itself (Yin et al., 24 Aug 2025).
Those ablations isolate the text module. On ImageNet and the 10-dataset average, AWT obtains 4 and 5; adding only visual enhancement yields 6 and 7; adding text enhancement without filtering yields 8 and 9; adding text enhancement with the full TGSSG filter yields 0 and 1; and the full CPE-OT system yields 2 and 3. The paper’s stated takeaway is that textual enhancement alone gives most of the gain, while entropy-plus-topology filtering remains necessary: the average improves from 4 without filtering to 5 with the full TGSSG filter (Yin et al., 24 Aug 2025).
The synonym-count study further indicates that multiple synonyms are required to capture semantic variation. With 6, the 10-dataset average is 7; with default 8, it rises to 9, after which gains saturate. Computationally, the overall CPE-OT inference time is reported as approximately 0 s per image versus 1 s for AWT, described as a modest 2 increase (Yin et al., 24 Aug 2025).
A closely related result is reported by 3, which constructs a synonymous semantic space for each class using LLM-generated synonyms and descriptors, a Vietoris–Rips complex, and a point-to-local-center similarity. Across 17 benchmarks, 4 reports 5 average on fine-grained zero-shot classification, and the homology ablation shows 6 without homology versus 7 with homology, indicating that topology-guided filtering contributes materially in this neighboring formulation as well (Yin et al., 2024).
6. Scope, limitations, and research context
TGSSG belongs to a broader research trajectory on synonymous semantic generation, but its specific combination of LLM synonym generation, CLIP embedding, entropy filtering, and persistent homology is distinctive. An important precursor is Turney’s work on semantic composition and decomposition as generation, where noun-modifier bigrams and noun unigrams are mapped to synonymous forms through a two-pass architecture consisting of a fast unsupervised candidate generator and a slower supervised reranker. In that setting, the top-100 most highly ranked unigrams include a WordNet synonym of the given bigram 8 of the time, and the top-100 most highly ranked bigrams include a WordNet synonym of the given unigram 9 of the time (Turney, 2014). That line is explicitly about synonymous semantic generation, but it does not use persistent homology or explicit topological data analysis.
The closest methodological neighbor is 0, which likewise starts from LLM-generated synonymous concepts, constructs a continuous yet compact synonymous semantic space via the Vietoris–Rips complex, and uses a point-to-local-center metric for image-to-class similarity (Yin et al., 2024). TGSSG can be viewed as operating in the same general design space, but within CPE it is paired with semantic ambiguity entropy, classwise persistence thresholding, and downstream CPE-TTA/CPE-OT matching.
A different theoretical backdrop comes from semantic communication. “A Mathematical Theory of Semantic Communication” formalizes synonymy through synonymous mappings, defines semantic entropy 1, semantic mutual information, semantic capacity 2, and semantic rate-distortion 3, and proves that 4, 5, and 6 (Niu et al., 2024). “Semantic Arithmetic Coding using Synonymous Mappings” then operationalizes this viewpoint by coding over synonymous sets rather than raw syntactic symbols (Liang et al., 2024). These works are not prompt-construction methods for VLMs, but they provide a formal account of synonymy as an equivalence-class structure.
The phrase “topology-guided” also has a broader meaning in controlled text generation. Transformer-based syntactic guidance has used constituency parse trees, path attention, and multi-encoder attention to generate paraphrases that preserve semantics while following explicit tree structure (Li et al., 2020). Explicit syntactic guidance has also been formulated as top-down generation over constituency trees with structural beam search, improving paraphrase quality, interpretability, controllability, and diversity (Li et al., 2023). This suggests that adjacent literatures use “topology” in at least two senses: homological structure of embedding clouds and explicit tree-structured control.
The current TGSSG formulation has several stated limitations. Synonym and description quality depend on the underlying LLM; persistent homology is compressed to a single scalar 7; ambiguous visual contexts can still create overlap that synonyms alone do not resolve; and the method introduces additional inference cost. The CPE paper accordingly identifies future directions such as full persistence diagrams, Wasserstein distances, class-dependent thresholds instead of a global 8, incorporation of external lexical resources such as WordNet or taxonomies, and extension to other modalities including video captions, scene graphs, and multilingual labels (Yin et al., 24 Aug 2025). A plausible implication is that TGSSG is best understood not as a terminal design, but as a concrete instance of topology-aware synonym-set construction for multimodal alignment.