Tree of Attributes Prompt Learning for Vision-Language Models

Prompt learning has proven effective in adapting vision language models for downstream tasks. However, existing methods usually append learnable prompt tokens solely with the category names to obtain textual features, which fails to fully leverage the rich context indicated in the category name. To address this issue, we propose the Tree of Attributes Prompt learning (TAP), which first instructs LLMs to generate a tree of attributes with a"concept - attribute - description"structure for each category, and then learn the hierarchy with vision and text prompt tokens. Unlike existing methods that merely augment category names with a set of unstructured descriptions, our approach essentially distills structured knowledge graphs associated with class names from LLMs. Furthermore, our approach introduces text and vision prompts designed to explicitly learn the corresponding visual attributes, effectively serving as domain experts. Additionally, the general and diverse descriptions generated based on the class names may be wrong or absent in the specific given images. To address this misalignment, we further introduce a vision-conditional pooling module to extract instance-specific text features. Extensive experimental results demonstrate that our approach outperforms state-of-the-art methods on the zero-shot base-to-novel generalization, cross-dataset transfer, as well as few-shot classification across 11 diverse datasets. Code is available at https://github.com/HHenryD/TAP.

Paper

References (70)

Scroll for more · 38 remaining

Similar papers

Reviewer Vt6k6/10 · confidence 5/52024-07-06

Summary

This paper proposes Tree of Attributes Prompt learning (TAP). Unlike previous works that rely on unstructured class descriptions, this approach distillates structured knowledge graphs associated with class names from LLMs. Text/vision prompts and vision-conditional pooling module are designed to extract instance-specific text features. Extensive experimental results demosntrate its improved performances.

Strengths

- Overall, the idea of distillating structured knowledge from LLMs in the task of prompt learning is new and interesting. - The paper designed an effective prompt learning framework to capture fine-grained attributes, using vision expert tokens and vision-conditional pooling layer. - The illustrated way to generate structure tree of attribute from LLMs can also be used in other tasks. - From the experiments, using structured knowledge leads to better performances than unstructured descriptions in base-to-novel and few-shot classification tasks. - The visualization of class activation maps and attention weights look good. The paper is well written and easy to follow.

Weaknesses

- Apart from the new framework, the method highly relies on the quality of tree of attribute generated with GPT-3.5-turbo. There is no study on the robustness aganist different LLMs, different generation prompts, or varying attribute sets. - The loss includes a model regularization and its effectiveness is not discussed. - In Figure 2, it is not too clear to me about $I_1 T_1$, $I_2 T_2$,etc. They seem not be discussed in the text parts.

Questions

- In Table 6, what is the difference between Attn. Max Pooling and VPC? Is that the former selects one most similar while the latter uses a soft weighted sum? - In Table 5, why using an adaptive number of attributes is better than a fixed 8 number of experts. When increasing the number of experts from 1 to 8, did the authors observe some patterns in the order of added attributes? Say, at the beginning some general attributes, then finer ones, and later irrelevant ones? - In Ln 189, could the authors clarify 'deep prompting'. Does it mean, in additional to vision prompt tokens at the input layer, there are other vision prompt tokens inside vision encoder not plotted in Figure 2? - In Eq. 7, could the authors clarify how $\alpha=0.4$ is chosen, and compare the performances of using CLS token only $\alpha=1.0$? - In Ln 262, how to revert to unstructured set of descriptions? Are they converted from the same tree of attributes by keeping all attributes and descriptions?

Rating

6

Confidence

5

Soundness

4

Presentation

3

Contribution

3

Limitations

One limitation is its reliance on LLMs (GPT) to generate the tree of attribute. When generating more complex responses, it is challening to ensure the quality and variances. How to keep a balance between the diversity of attribute sets and relevancy of attributes to classification is important.

Reviewer grEg4/10 · confidence 4/52024-07-12

Summary

This paper proposes a new method called "Attribute Prompt Learning Tree (TAP)" to improve the performance of CLIP on zero-shot and few-shot classification tasks. The authors leverage large language models (LLMs) to generate more descriptive text prompts and introduce a hierarchical tree-like structure to systematically generate and integrate these descriptions, ensuring a layered and comprehensive understanding of the visual content. The method also learns specialized "domain expert" prompt tokens that focus on different visual attributes and uses a vision-based pooling module to extract text features for specific instances. Extensive experiments show that TAP outperforms state-of-the-art methods on zero-shot and few-shot classification tasks across multiple datasets

Strengths

1), The idea that utilizing LLM to generate tree-like prompts makes sense. This structured description approach is significantly different from the existing simple text prompt methods and provides an efficient way to improve VLMs. 2), The image-conditional pooling module looks like good for capturing instance-specific features. 3), Experiments and visualization demonstrate the effectiveness of the proposed model.

Weaknesses

1), TAP introduces many textual and visual prompts, which leads to high computing and time costs. This may limit its applications. 2), TAP first generates hierarchical token prompts, while it seems like TAP does not use such a hierarchical structure to integrate the output of the text encoder. It only uses a pooling strategy to update the text encoder output with the visual feature. That is, TAP also does not utilize these relationships in the prompt graph. 3), TAP can be viewed as a multimodal prompt tuning method. What is the main difference between TAP and MAPLE, ALIGN.

Questions

Please see above

Rating

4

Confidence

4

Soundness

2

Presentation

3

Contribution

3

Limitations

None

Reviewer 1xvn8/10 · confidence 5/52024-07-12

Summary

This paper propose a method that aiming to align the vision modality with not only the category name but also the whole concept subgraph the noun represents in the knowledge graph. This is achieved by adding a bunch of attributes branches attached to this concept. The authors argue that this integration of attribute knowledge will make the alignment more transferrable and thus result in a good performance boost in terms of zero/few shot results. Basically, this work focusing on the topic of textual prompt enrichment task that is investigated before but implement in a different manner. Additionally, the proposed method use seperate tokens to learn different aspectrs of attributes of given images, working as 'domain expert'.

Strengths

1. Might be the first work trying to align the vision image with structured data. It is quite interesting considering that most text prompts now are less organized and noisy. And structured data, as pointed out in the recent research of LLM, may lead to better reasoning skill for a foundation model. 2. The proposed vision-conditional pooling can help the model filter out descriptions that are not direct appeared in the image. 3. Recieve good results on different classification datasets with the model trained with this method.

Weaknesses

1. The attributes description is generated by the LLM, which could contain hallucinated content. While there are many reliable sources of knowledge such as wikipedia or conceptNet, this paper seems skip these sources to obtain some accurate attributes. 2. Though this paper decide to use a tree structure to represent the concept. The built tree is not encoded in a structure-awared manner. They are still feed as langauge tokens to the LLMs. 3. in equation (5), what is $v_y^a$ stands for? 4. The author argued that the vision-conditional pooling, which is bascially a cross attention layer between the visual and language modal. The authors believe this this design will make the model filter out non-exisiting material in the text description. However, we know that due to the quirk of softmax function. You can never make some tokens attention to be '0'. Thus, the model is learning some spurious correlation aftertall.

Questions

1. Why structured description is so important in your presumption? Given that only the text prompts are structured but visual data are not, will this fact hinder the model to learn a structured in-detail alignment? 2. How do you make sure one expert token will only learn from one attribute? 3. Can the model trained this way also work well on the downstream tasks?

Rating

8

Confidence

5

Soundness

4

Presentation

3

Contribution

4

Limitations

Not applicable.

Reviewer ZE3g4/10 · confidence 4/52024-07-17

Summary

The TAP method structures textual descriptions in a hierarchical “concept-attribute-description” format, effectively creating a knowledge graph from large language models (LLMs) for each category name. This structure allows for a more comprehensive and detailed understanding of the visual content. The paper reimagines learnable prompt tokens as "domain experts," each specializing in different aspects of the image, supplemented by a global perspective provided by the CLS token. To address potential misalignment between general descriptions and specific image content, the paper introduces a vision-conditional pooling module. This module extracts instance-specific text features, ensuring optimal image-text alignment.

Strengths

The proposed method incorporates structured tree of attribute into prompt tuning that provide richer supervisory information compared to unstructured attribute information. A set of experiments has been conducted, and the results look promising.

Weaknesses

One major limitation of the method is that it requires human review to "ensure the quality of the example" (L175). Recall that one major advantage of prompt tuning is that it can adapt large models quickly to specific tasks. However, the requirement of human reviewing in the proposed method is not consistent with this goal. In addition, it is not clear how many human efforts are needed here, and how to handle the potential human bias in quality evaluation. The paper lacks cross-dataset experiments, which is typically provided in existing PT papers. The results are important to examine the domain generalization capability of the method. For training details, different learning rates were used for different datasets, however, existing methods typically use a same LR for all datasets. From this point, the comparison is somewhat unfair.

Questions

In Section 3.3, for attribute generation, what type of dataset information is given to the large model? In Figure 4, each image is accompanied by only two descriptions. Are all images described using two sentences each? In this paper, it mentions that the method can capture subtle differences between attributes. Could you provide a relevant example?

Rating

4

Confidence

4

Soundness

2

Presentation

3

Contribution

2

Limitations

yes

Reviewer bYva5/10 · confidence 4/52024-07-22

Summary

This paper proposes a new prompt tuning method for adapting the vision-language model. The authors design the tree of attribute prompt learning to substitute the categorical description for adapting the vision-language model. A vision-conditional pooling module is proposed to extract instance-specific text features. Extensive experimental results demonstrate the effectiveness of the proposed method.

Strengths

1. A tree of attribute prompt learning method is proposed to guide the adatpation of VLM with the hierarchical semantic information. 2. This paper is well-written and easy to follow.

Weaknesses

1. According to the experiment, the performance improvement of TAP is marginal, e.g., the few-shot performance on most of datasets. Although the visualization results of VCP layer are impressive, the improvement of this module is also very slight compared to average pooling. 2. The core motivation of this method is learning fine-grained attributes to adapt VLMs. However, similar ideas have been explored in previous works , e.g., APPL[1], MAP[2]. Please discuss the differences. [1] AAPL: Adding Attributes to Prompt Learning for Vision-Language Models [2] Multi-modal Attribute Prompting for Vision-Language Models 3. The construction of ToA depends heavily on the prior information on the category of attributes suitable for the dataset. However, one of the most capability of VLM is its zero-shot ability in the open-vocabulary context. What's the performance of the proposed method in the domain generalization setting? 4. The model details in Figure 2 are not presented very clear, especially the input & output streams. This figure should be refined for better clarity. 5. The mechanism behind Equation (5) and the function of VCP needs more clarification. Why conduct constrastive learning between expert token P_a^v and attribute embedding v_c^a generated from P_a^v itself, instead of P_a^v and the embedding of attribute descriptions D?

Questions

Please refer to Weaknesses.

Rating

5

Confidence

4

Soundness

3

Presentation

2

Contribution

2

Limitations

Yes.

Reviewer Vt6k2024-08-10

I would like to thank the authors for their detailed responses, which solved my previous questions.

Authorsrebuttal2024-08-12

Thank you

Thank you again for your positive assessment and for taking the time to review our work. Your invaluable feedback has been instrumental in improving our paper.

Area Chair if7Y2024-08-11

Reminder -- please reply to rebuttal

Dear Reviewers, Thank you for your comments. Please read through all the reviews and the rebuttal and see if authors' responses have addressed your and others' concerns. Best, AC

Reviewer bYva2024-08-11

Reply to rebuttal

The responses have addressed all my questions.

Authorsrebuttal2024-08-12

Thank you

Thank you again for your positive assessment and for taking the time to review our work. Your invaluable feedback has been instrumental in improving our paper.

Reviewer 1xvn2024-08-12

1. Many works have validate that including knowledge sources or using RAG can alleviate hallucination problem. So I believe if you can insert a paragraph from a reliable sources to the LLM as context, the LLMs will generate more reliable results comparing to direct doing QA. 2. Thank you for your explanation. From my understanding, you grouped a collection of discription for each attribute by using VCP and each VCP is aligned with an Expert token to reflect the two-level hirerachical structure, is that correct? I was expecting there is a Graph embedding or something close to embed the tree structure. But I still find this implementation is interesting. Good job. 3. I'd like to learn more about the visiual Expert tokens in 3.4. So, you said that you have A independent tokens serve as Expert tokens. And you insert these vision expert tokens before the image patch sequence like what VPT. Then I wonder, are you inserting all the expert tokens together into the image embedding sequences? If that is the case, when doing the cross attention mentioned in 3.5, how do you make sure only the relevant Expert tokens is doing cross-pooling with the relevant attributes, as described in equation 4. Please answer this question clearly and in detail. I will consider to raise my rating if I received a satisfying response.

Authorsrebuttal2024-08-12

1. Thank you for your suggestion. We agree that incorporating reliable sources as context before querying the LLM could generate more accurate and reliable results. We will certainly explore this direction in our future work to further enhance the robustness of our method. 2. Thank you for your compliment and understanding. You are correct that our approach groups a collection of descriptions for each attribute using VCP, and each VCP is aligned with an expert token to reflect a hierarchical structure. To clarify further, the structure in our method is actually three levels: - Class Name (Root Node) → Attributes (Intermediate Layer) → Descriptions (Leaf Nodes) VCP helps aggregate from descriptions to attributes (from leaf nodes to the attribute layer). Then, the prediction fusion via weighted sum aggregates the attribute predictions into the final class prediction (from the attribute layer to the root node). While we did not use an explicit graph embedding to represent the tree structure, we implemented the hierarchical structure in a more implicit manner through this approach. We appreciate your positive feedback on this implementation. 3. Thank you for providing me the opportunity to clarify. Yes, all expert tokens are indeed inserted together into the image embedding sequences, similar to what VPT did. To ensure only the relevant expert token is doing cross-attention, we used a separate VCP module for each expert token. Concretely, - The number of attributes in the Tree of Attributes (ToA) equals the number of expert tokens added, which also equals the number of VCP modules. - Each attribute description set is aggregated using a dedicated VCP module that operates solely for that attribute. The pooled embedding from this VCP module is then aligned with the specific expert token associated with that attribute. - In the VCP module (batch size is omitted for simplicity in the following notation): - The query is the expert token of shape $1\times D$ (where $D$ is the embedding dimension). - The key is the set of descriptions in this attribute, with shape $N\times D$ (where $N$ is the number of descriptions). - The resulting pooled embedding, after cross-attention, is of shape $1\times D$, which aligns directly with the expert token (also of shape $1\times D$). This design ensures that each expert token only interacts with its relevant attribute. I hope this detailed explanation clarifies your concerns. Please feel free to ask any further questions, and I sincerely appreciate your consideration in potentially raising the rating.

Reviewer 1xvn2024-08-12

Thank you for your response. For 3, I'd like to ask further questions as following: 1. I understood that you are using a expert token to do cross-attention for only one group of description. But my problem is, during implementation, how do you select a SPECIFIC expert token to do attention? In your response, you said you insert a bunch of expert tokens into the image embedding sequences. From my understanding, the sequence of are with the shape $E \times D$ now, where E is the size of expert tokens. When you do cross-attention, all the expert tokens will have exposure to the description embedding, isn't it? How do you avoid such exposure? In other words, how to you implement the one expert to one attribute part in your codes? Would you like to share that part? 2. Another question is, you mentioned in your paper said that VCP module is also responsible for filtering out non-related descriptions. Do you have any experiments to show that VCP can actually filtering out those descriptions? Because we all know that some not all descriptions will present in a same image for an object.

Authorsrebuttal2024-08-12

Thank you for your follow-up question. 1. I apologize for any confusion caused. In our implementation, each expert token is aligned with only one specific attribute's descriptions, ensuring no cross-interference with other attributes. Here’s how this works in practice: - Text Input as a Dictionary: The text input, representing the Tree of Attributes (ToA), is formatted as a dictionary: ToA = {'color': [color description set], 'shape': [shape description set], ...} After processing through the text encoder, the ToA is embedded as a tensor of shape $E\times N\times D$, where E is the number of attributes (e.g., color, shape), N is the number of descriptions per attribute (to ensure equal length, we apply zero-padding). - Expert Tokens Interaction: Each expert token from the vision encoder is aligned with its corresponding attribute's descriptions. This is achieved by iterating over each attribute and ensuring that the expert token interacts only with the relevant attribute's descriptions. Below is a pseudocode illustration of this process: ``` text_embed = text_encoder(ToA) # ToA is a dictionary, text_embed is E x N x D image_tokens = vision_encoder(image) # E x D pooled_embeds = [] for i in range(E): expert_token = image_tokens[i] # 1 x D attribute_embed = text_embed[i] # N x D pooled_embed = VCP(expert_token, attribute_embed) # 1 x D pooled_embeds.append(pooled_embed) ``` This process ensures that each expert token is aligned and performs cross-attention only with its corresponding attribute descriptions. The attribute of a vision expert token is determined by the corresponding group of textual descriptions. Although we omitted the handling of multiple classes and batch size for simplicity, in our actual implementation, we used tools like einops to make the process more efficient. We will release our code. 2. Yes, we have conducted both quantitative and qualitative experiments to demonstrate that the VCP module can effectively filter out irrelevant descriptions. Quantitatively, in Table 6, we ablated the design choices for the pooling layer, comparing VCP against average pooling and attention-based max pooling which only pools one description that has the highest attention score per attribute. The results show that VCP significantly outperforms these alternatives. Qualitatively, we visualized the attention weights of VCP in Figure 4. We observe that the model assigns higher attention to relevant descriptions while giving near-zero attention to incorrect or unrelated ones. This behavior illustrates VCP's ability to focus on the descriptions that are most pertinent to the image content, effectively filtering out those that do not apply. I hope this explanation clarifies the implementation. If you have any further questions or need more details, I’m happy to provide additional information. Thank you for your consideration, and I look forward to your feedback.

Reviewer grEg2024-08-12

I thank the authors for their detailed response, and I have read other comments. I decide to keep my rating.

Authorsrebuttal2024-08-12

Dear Reviewer, Thank you for your response. Could you please let us know if there are any specific concerns that remain? We are more than happy to address any further issues during the discussion period.

Area Chair if7Y2024-08-13

Please respond to the authors' rebuttal

Dear Reviewer ZE3g, Thank you again for reviewing this paper. Since the reviewer-author discussion phase is closing soon, could you please respond to the authors' comments? Best, AC

Authorsrebuttal2024-08-13

Thank you

Thank you for your recognition of our work and for increasing your rating. Regarding your question about the efficiency of the iterative training approach: To improve efficiency, we used einops rearrange to manage multiple classes and batch sizes, along with zero-padding and attention masks to handle varying numbers of descriptions across attributes. We note that these implementations can already maintain a high training effiency. Thank you for your nice suggestion. We will certainly further explore more strategies to improve training efficiency. Thank you again for your valuable feedback and for the increase in your rating.

Reviewer ZE3g2024-08-13

Reply to rebuttal

Thanks for the rebuttal. It addresses some of my concerns but one major concern still exists. One limitation of the method is that it requires many tunings specific to each dataset in order to achieve good performance. The tuning process involves two key aspects: __Human Intervention (W1)__: thought the required human effort is minimal, its impact on model performance remains unclear after the rebuttal. __Learning Rate Variability (W3)__: The method employs different learning rates for different datasets. While TaskRes is trained in a similar manner, the experiments lack comparative analysis with this approach. Additionally, further discussion is needed on how to determine the most appropriate learning rate for a given dataset. I expect authors provide additional insights regarding this issue.

Authorsrebuttal2024-08-13

Thank you for your follow-up questions. W1. We apologize for any confusion. To clarify, the human review stage is designed to ensure the quality of LLM-generated descriptions. In practice, we found the LLM-generated descriptions good enough and no manual editing was involved in this stage. Therefore, even if we remove this stage, our model would still achieve the same results. Additionally, in the LLM robustness experiment requested by Reviewer Vt6k, we regenerated the descriptions using Qwen2-7B-Instruct without any human review due to the limited time during the rebuttal process. The results are as follows: | Base | Novel | HM | |------|-------|----| | 84.68 | 77.31 | 80.83 | These robust results show that the method's performance is maintained. W3. We apologize for not including TaskRes as one of our baselines. We compare TAP and TaskRes in the 16-shot setting as follows: | Method | ImageNet | SUN | Aircraft | EuroSAT | Cars | Food | Pets | Flowers | Caltech | DTD | UCF | Average | |--------|----------|-----|----------|---------|------|------|------|---------|---------|-----|-----|---------| | TaskRes | 73.0 | 76.1 | 44.9 | 82.7 | 83.5 | 86.9 | 92.4 | 97.5 | 95.8 | 71.5 | 84.0 | 80.8 | | TAP | 73.8 | 77.3 | 50.4 | 91.9 | 85.4 | 87.5 | 93.9 | 98.1 | 96.7 | 74.9 | 87.2 | 83.4 | TAP outperforms TaskRes on all datasets, with an average improvement of 2.6% across the 11 datasets. Regarding the determination of learning rates, we apologize for not being clear enough in our rebuttal. We grouped the datasets based on the number of attributes and adjusted the learning rates for vision and text encoders separately based on our intuition to balance generalizability and performance. Concretely, for the vision encoder, datasets that have fewer attributes also have fewer learnable expert tokens (thus fewer parameters and lower learning difficulty), we used a larger learning rate (0.006 vs. 0.004) to facilities the learning process. For text encoder, the number of learnable text prompts is fixed, where fewer attributes provide fewer text descriptions/data, and thus a smaller learning rate (0.002 vs. 0.004) was used to avoid overfitting. We hope this additional context clarifies our approach. Thank you again for your thoughtful feedback and for considering these points in your evaluation.

Program Chairsdecision2024-09-25

Decision

Reject

© 2026 NYSGPT2525 LLC