# documents

url: https://www.techtarget.com/searchenterpriseai/definition/chain-of-thought-prompting
title: What is Chain-of-Thought Prompting (CoT)? Examples and Benefits | TechTarget
scrape_date: 2025-03-17T15:29:34.122055
content_type: markdown
hash: 9370b599c8d90fc384aa25e5c8d6ac13e445057143fc6c1f5562dbd0941d3c9b
content:
__ Search Enterprise AI __ Search the TechTarget Network __

[Login](https://www.techtarget.com/login) [Register](https://www.techtarget.com/register)

[Explore the Network]()

  * [TechTarget Network](https://www.techtarget.com/network/)
  * [Business Analytics](https://www.techtarget.com/searchbusinessanalytics/)
  * [CIO](https://www.techtarget.com/searchcio/)
  * [Data Management](https://www.techtarget.com/searchdatamanagement/)
  * [ERP](https://www.techtarget.com/searcherp/)



  * [ Search Enterprise AI ](https://www.techtarget.com/searchenterpriseai/)

  *     * [AI Business Strategies](https://www.techtarget.com/searchenterpriseai/resources/AI-business-strategies)
    * [AI Careers](https://www.techtarget.com/searchenterpriseai/resources/Careers-in-artificial-intelligence)
    * [AI Infrastructure](https://www.techtarget.com/searchenterpriseai/resources/AI-infrastructure)
    * [AI Platforms ](https://www.techtarget.com/searchenterpriseai/resources/Artificial-intelligence-platforms)
    * [AI Technologies](https://www.techtarget.com/searchenterpriseai/resources/AI-technologies)
    * More Topics __

      * [Applications of AI](https://www.techtarget.com/searchenterpriseai/resources/Enterprise-applications-of-AI)
      * [ML Platforms](https://www.techtarget.com/searchenterpriseai/resources/Machine-learning-platforms)

Other Content
    * [News](https://www.techtarget.com/news/)
    * [Features](https://www.techtarget.com/searchenterpriseai/features)
    * [Tips](https://www.techtarget.com/searchenterpriseai/tips)
    * [Webinars](https://www.techtarget.com/searchenterpriseai/webinars)
    * [2024 IT Salary Survey Results](https://www.bitpipe.com/detail/RES/1726500895_726.html?asrc=2024salaryandcareers)
    * [Sponsored Sites](https://www.techtarget.com/searchenterpriseai/sponsored_communities)
    * More __

      * [Answers](https://www.techtarget.com/searchenterpriseai/answers)
      * [Conference Guides](https://www.techtarget.com/searchenterpriseai/guides)
      * [Definitions](https://www.techtarget.com/searchenterpriseai/definitions)
      * [Opinions](https://www.techtarget.com/searchenterpriseai/opinions)
      * [Podcasts](https://www.techtarget.com/searchenterpriseai/podcasts)
      * [Quizzes](https://www.techtarget.com/searchenterpriseai/quizzes)
      * [Tech Accelerators](https://www.techtarget.com/searchenterpriseai/techaccelerators)
      * [Tutorials](https://www.techtarget.com/searchenterpriseai/tutorials)
      * [Videos](https://www.techtarget.com/searchenterpriseai/videos)



  * Follow:
  * [__](https://x.com/techtargetnews)
  * [__](https://www.linkedin.com/showcase/techtarget-news/)
  * [__](https://www.youtube.com/c/EyeonTech)
  * [__](https://www.tiktok.com/@eyeontech)
  * [__](https://www.facebook.com/TechTargetBusinessTechnology/)



  * [Home](https://www.techtarget.com/searchenterpriseai/)
  * [AI technologies](https://www.techtarget.com/searchenterpriseai/resources/AI-technologies)



__ Tech Accelerator [What is GenAI? Generative AI explained](https://www.techtarget.com/searchenterpriseai/definition/generative-AI)

[Prev](https://www.techtarget.com/searchenterpriseai/definition/Gemma) [Next](https://www.techtarget.com/searchenterpriseai/definition/AI-red-teaming) __What is Gemma? Google's open sourced AI model explained __What is AI red teaming?

__Download this guide 1

X

__ Free Download **What is generative AI? Everything you need to know**

## The potential of AI technology has been percolating in the background for years. But when ChatGPT, the AI chatbot, began grabbing headlines in early 2023, it put generative AI in the spotlight. This guide is your go-to manual for generative AI, covering its benefits, limits, use cases, prospects and much more.

Definition

# What is chain-of-thought prompting (CoT)? Examples and benefits 

  * Share this item with your network:
  * __
  * __
  * __
  * __
  * __



  * __
  * __
  * __
    * __
    * __
    * __
    * __



By

  * [Cameron Hashemi-Pour,](https://www.techtarget.com/contributor/Cameron-Hashemi-Pour) Former Site Editor
  * [Lev Craig,](https://www.techtarget.com/contributor/Lev-Craig) Site Editor



Chain-of-thought (CoT) prompting is a [prompt engineering](https://www.techtarget.com/searchenterpriseai/definition/prompt-engineering) technique that aims to improve language models' performance on tasks requiring logic, calculation and decision-making by structuring the input [prompt](https://www.techtarget.com/searchenterpriseai/definition/AI-prompt) in a way that mimics human reasoning.

To construct a CoT prompt, a user typically appends an instruction such as "Describe your reasoning in steps" or "Explain your answer step by step" to the end of their query to a large language model ([LLM](https://www.techtarget.com/whatis/definition/large-language-model-LLM)). In essence, this prompting technique asks the LLM to not only generate a result, but also detail the series of intermediate steps that led to that answer.

Guiding the model to articulate these intermediate steps has shown promising results. "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models" is a seminal [paper](https://arxiv.org/abs/2201.11903) by the Google Brain -- now DeepMind -- research team, presented at the 2022 NeurIPS conference. The researchers found that CoT prompting outperformed standard prompting techniques on a range of arithmetic, commonsense and symbolic reasoning benchmarks.

## __How does CoT prompting work?

CoT prompting takes advantage of LLMs' capabilities, such as a sophisticated ability to generate fluent language. It does this to simulate techniques from human [cognitive processing](https://www.techtarget.com/searchenterpriseai/definition/cognitive-modeling), such as planning and sequential reasoning.

This article is part of

### __[What is GenAI? Generative AI explained](https://www.techtarget.com/searchenterpriseai/definition/generative-AI)

  * Which also includes:
  * [8 top generative AI tool categories for 2025](https://www.techtarget.com/searchenterpriseai/tip/Top-generative-AI-tool-categories)
  * [Will AI replace jobs? 17 job types that might be affected](https://www.techtarget.com/whatis/feature/Will-AI-replace-jobs-9-job-types-that-might-be-affected)
  * [25 of the best large language models in 2025](https://www.techtarget.com/whatis/feature/12-of-the-best-large-language-models)



When people are confronted with a challenging problem, they often break it down into smaller, more manageable pieces. For example, solving a complex math equation typically involves several substeps, each of which is essential to arriving at the final correct answer. CoT prompting asks an LLM to mimic this process of decomposing a problem and working through it step by step -- essentially, asking the model to "think out loud," rather than simply providing a solution.

The screenshot below shows an example of how chain-of-thought prompting works. The user presents OpenAI's [ChatGPT](https://www.techtarget.com/whatis/definition/ChatGPT) with a classic river-crossing logic [puzzle](https://illuminations.nctm.org/BrainTeasers.aspx?id=4992), adding the phrase "Describe your reasoning step by step" at the end of the prompt. When the chatbot responds, it sequentially works through the problem, describing each crossing leading up to the final answer.

__GPT-4 provides a step-by-step solution to a logic puzzle in response to a chain-of-thought prompt.

__

The following are other examples of CoT prompts:

  * "John has one pizza, cut into eight equal slices. John eats three slices, and his friend eats two slices. How many slices are left? Explain your reasoning step by step."
  * "Alice left a glass of water outside overnight when the temperature was below freezing. The next morning, she found the glass cracked. Explain step by step why the glass cracked."
  * "If all roses are flowers, and some flowers fade quickly, can we conclude that some roses fade quickly? Explain your reasoning in steps."
  * "A classroom has two blue chairs for every three red chairs. If there are a total of 30 chairs in the classroom, how many blue chairs are there? Describe your reasoning step by step."



## __Different approaches to CoT prompting

CoT prompting has multiple variants, each of which uses a different approach to getting LLMs to explain their outputs:

  * **Auto-CoT.** In automatic CoT, the user crafts a few examples of inputs and desired outputs for an LLM to learn, including the intermediate steps taken to achieve those outputs. The LLM then learns from these examples and automatically applies the same reasoning to future interactions with the user.
  * **Multimodal CoT.** LLMs that are capable of processing inputs besides text -- such as audio, image and video -- are [multimodal AI](https://www.techtarget.com/searchenterpriseai/definition/multimodal-AI). An example of multimodal CoT would be asking an LLM to examine images when explaining and justifying outputs.
  * **Zero-shot CoT.** With this approach, the user doesn't provide an LLM with any examples for it to reference, instead asking it to "show its work" and explain how it achieved its output. This process is efficient, but not as effective for complex inputs; zero-shot chain of thought is best suited for simpler problems.
  * **Least-to-most CoT.** With this approach, a user breaks a large problem into smaller subproblems and sends each one to the LLM sequentially. The LLM can then solve each subsequent subproblem more easily using the answers to previous subproblems for reference.



[Few-shot](https://www.techtarget.com/searchenterpriseai/feature/Few-shot-learning-explained-What-you-should-know) prompting and traditional or standard prompting are similar to CoT, but aren't considered CoT. Standard prompting doesn't require LLMs to provide complex reasoning and justify their outputs; producing an output is all that matters in the standard approach. Few-shot prompting means a user provides examples of desired outputs to similar inputs -- such as answers to similar math problems -- to help guide the LLM. However, it doesn't classify as a CoT approach.

## __Advantages of CoT prompting

CoT prompting offers several advantages:

  * **Better responses.** LLMs can only take in a limited amount of information at one time. Breaking down complex problems into simpler subtasks helps mitigate this issue. It lets LLMs process those smaller components individually, leading to more accurate and precise model responses.
  * **Expanded knowledge base.** CoT prompting takes advantage of LLMs' extensive pool of general knowledge. LLMs are exposed to a wide array of explanations, definitions and problem-solving examples during their training on vast textual data sets, encompassing books, articles and much of the open internet. CoT prompts tap into this reservoir of stored knowledge by triggering the model to call on and apply relevant information.
  * **Logical reasoning.** The technique directly targets a [common limitation of LLMs](https://www.techtarget.com/searchenterpriseai/tip/What-are-the-risks-and-limitations-of-generative-AI): difficulty with logical reasoning. Although LLMs excel at generating coherent, relevant text, they weren't primarily designed to provide information or solve problems. Consequently, they often struggle with complex reasoning tasks and logic, especially for more complex problems. CoT prompting addresses this issue by guiding the model to take a structured reasoning approach. It directs the model to construct a logical pathway from the original prompt or problem statement to the final answer, reducing the likelihood of logical missteps and oversights.
  * **Debugging.** CoT prompting assists with model [debugging](https://www.techtarget.com/searchsoftwarequality/definition/debugging) and improvement by providing transparency in the process by which a model arrives at its answer. Because the prompts ask the model to explicitly delineate a reasoning process, they give model testers and developers better insight into how the model reached a particular conclusion. This, in turn, makes it easier to identify and correct errors when refining the model.
  * **Fine-tuning.** Developers can combine CoT prompting with [fine-tuning](https://www.techtarget.com/searchenterpriseai/definition/fine-tuning) to enhance LLM reasoning capabilities. For example, fine-tuning a model on a training data set containing curated examples of step-by-step reasoning and logical deduction can improve the effectiveness of CoT prompting.



## __Limitations of CoT prompting

Importantly, as the Google research team highlighted in its paper, the semblance of reasoning that CoT prompts elicit from LLMs doesn't mean the model is thinking. It's essential to remember that the model is a deep learning [neural network](https://www.techtarget.com/searchenterpriseai/definition/neural-network) trained to predict text sequences based on probability. There's no evidence to suggest that LLMs are capable of reasoning as people do. This distinction is crucial for users to understand the limitations of LLMs and maintain realistic expectations about their capabilities.

LLMs lack consciousness and metacognition, and their general knowledge derives solely from their training data -- reflecting that data set's errors, gaps and [biases](https://www.techtarget.com/searchenterpriseai/definition/machine-learning-bias-algorithm-bias-or-AI-bias). Although an LLM can accurately mimic the structure of logical reasoning, this doesn't mean its conclusions are always accurate. CoT prompts serve as a valuable organizing mechanism for LLM output, but an LLM could nevertheless present a coherent, well-structured output that contains logical errors and oversights.

Techniques such as [retrieval-augmented generation](https://www.techtarget.com/searchenterpriseai/definition/retrieval-augmented-generation) show promise for mitigating this limitation. RAG lets an LLM access an external source -- such as a vetted database or the internet -- in real time when asked to deliver information. In this way, RAG eliminates the need for the LLM to rely solely on the internal knowledge base gleaned from its training data, which might be flawed or incomplete.

However, while RAG can improve the accuracy and timeliness of an LLM's outputs, it doesn't inherently address the problem of logical reasoning. Deduction and reasoning require more than just factual recall; they also involve the ability to derive conclusions through logic and analysis. These are aspects of AI performance that are more closely related to the algorithmic architecture and training of the LLM itself.

Also, the scalability of CoT prompting remains in question. Although the underlying principle of sequential, multistep reasoning is applicable to AI and [machine learning](https://www.techtarget.com/searchenterpriseai/definition/machine-learning-ML), CoT prompting is limited to LLMs because of their sophisticated performance on language tasks.

LLMs' large size requires significant data, compute and infrastructure, which raises issues around accessibility, efficiency and [sustainability](https://www.techtarget.com/searchenterpriseai/feature/Designing-systems-that-reduce-the-environmental-impact-of-AI). In response to this problem, AI researchers have developed [small language models](https://www.techtarget.com/searchenterpriseai/news/366563445/Small-language-models-an-emerging-GenAI-force), which -- while less powerful than LLMs -- perform competitively on various language tasks and require fewer computational resources. However, it remains to be seen whether the benefits of CoT prompting are transferable to smaller models, as reducing their capabilities risks compromising their problem-solving effectiveness.

It's important to keep in mind that CoT prompting is a technique for using an existing model more effectively, not a training method. While these prompts can help users elicit better results from pretrained LLMs, prompt engineering isn't a cure-all and can't fix model limitations that should have been handled during the training stage.

## __CoT prompting vs. prompt chaining

Chain-of-thought prompting and [prompt chaining](https://www.techtarget.com/searchenterpriseai/definition/prompt-chaining) sound similar and are both prompt engineering techniques, but they differ in some important ways.

CoT prompting asks the model to describe the intermediate reasoning steps used to reason its way to a final answer within one response. This is useful for complex tasks that require detailed explanation, planning and reasoning, such as math problems and logic puzzles, where explaining the thought process is essential to fully understanding the solution.

In contrast, prompt chaining involves an iterative sequence of prompts and responses, in which each subsequent prompt is formulated based on the model's output in response to the previous one. This makes prompt chaining a useful technique for more creative, exploratory tasks that involve gradual refinement, such as generating detailed narratives and brainstorming ideas.

The fundamental difference between CoT prompting and prompt chaining lies in iteration and interactivity. CoT prompting presents the reasoning process within a single detailed, self-contained response. Prompt chaining takes a more dynamic approach, with multiple rounds of interaction that enable users to develop an idea over time.

## __Use cases of CoT prompting

CoT is more than just an AI technique for LLM users and tech enthusiasts. There are real-world uses for CoT that help organizations perform tasks such as the following:

  * **Understanding regulations.** Legal experts can use chain-of-thought prompting to direct an LLM to explain new or existing regulations -- such as [laws surrounding data privacy](https://www.techtarget.com/searchsecurity/tip/State-of-data-privacy-laws) \-- and how those apply to their organization. This approach can also apply to writing new internal policies.
  * **Educating new employees.** An LLM can teach an organization's new hires about its internal policies. For example, a new hire can use CoT prompting to ask an LLM which policies would apply to a specific circumstance and why.
  * **Answering customer queries.** AI-powered chatbots are commonly [used in industries for customer interactions](https://www.techtarget.com/patientengagement/feature/Promising-patient-engagement-use-cases-for-GenAI-chatbots). In this case, a customer might need to complete a complex troubleshooting process, and a chatbot can explain how and why the customer would need to perform certain actions.
  * **Managing logistics and supply chains.** A logistics or transportation company could rely on this technique when asking an LLM to craft a better logistics strategy. The LLM would have to explain its answers and how they optimize logistics operations.
  * **Creating original content.** Generative AI tools could draft and organize text in a way that's easy for readers to understand, and it could explain why it did so. Long-form content, such as complex scientific research papers, could benefit from this approach.



_CoT prompting is one of multiple advanced strategies involved in prompt engineering. Learn other important[strategies and tips](https://www.techtarget.com/searchenterpriseai/tip/Prompt-engineering-tips-for-ChatGPT-and-other-LLMs)._

This was last updated in January 2025

####  __Continue Reading About What is chain-of-thought prompting (CoT)? Examples and benefits

  * [Prompt engineering tips and best practices](https://www.techtarget.com/searchenterpriseai/tip/Prompt-engineering-tips-and-best-practices)


  * [Prompt engineering vs. fine-tuning: What's the difference?](https://www.techtarget.com/searchenterpriseai/tip/Prompt-engineering-vs-fine-tuning-Whats-the-difference)


  * [Compare prompt engineering tools](https://www.techtarget.com/searchenterpriseai/feature/Compare-prompt-engineering-tools)


  * [Skills needed to become a prompt engineer](https://www.techtarget.com/whatis/feature/Skills-needed-to-become-a-prompt-engineer)


  * [AI engineers: What they do and how to become one](https://www.techtarget.com/whatis/feature/How-to-become-an-artificial-intelligence-engineer)



####  Related Terms

[What is Gemma? Google's open sourced AI model explained](https://www.techtarget.com/searchenterpriseai/definition/Gemma)
    Gemma is a collection of lightweight open source generative AI models designed mainly for developers and researchers.[ See complete definition __](https://www.techtarget.com/searchenterpriseai/definition/Gemma)
[What is GenAI? Generative AI explained](https://www.techtarget.com/searchenterpriseai/definition/generative-AI)
    Generative artificial intelligence, or GenAI, uses sophisticated algorithms to organize large, complex data sets into meaningful ...[ See complete definition __](https://www.techtarget.com/searchenterpriseai/definition/generative-AI)
[What is task automation?](https://www.techtarget.com/searchitoperations/definition/task-automation)
    Task automation uses technology to perform repetitive or routine tasks automatically, improving efficiency, minimizing mistakes ...[ See complete definition __](https://www.techtarget.com/searchitoperations/definition/task-automation)

####  __Dig Deeper on AI technologies

  * ##### [OpenAI o3 explained: Everything you need to know ![SeanKerner](https://www.techtarget.com/rms/onlineImages/kerner_sean.jpg) By: Sean Kerner ](https://www.techtarget.com/whatis/feature/OpenAI-o3-explained-Everything-you-need-to-know)
  * ##### [What is prompt chaining? Definition and benefits By: Cameron Hashemi-Pour ](https://www.techtarget.com/searchenterpriseai/definition/prompt-chaining)
  * ##### [What is prompt engineering? By: Cameron Hashemi-Pour ](https://www.techtarget.com/searchenterpriseai/definition/prompt-engineering)
  * ##### [What is LangChain and how to use it: A guide ![KinzaYasar](https://www.techtarget.com/rms/onlineimages/yasar_kinza.jpg) By: Kinza Yasar ](https://www.techtarget.com/searchenterpriseai/definition/LangChain)



__Sponsored News

  * [10 Reasons to Use a Subscription Model for On-Premises Infrastructure](https://www.techtarget.com/searchcio/MulticloudbyDesign/10-Reasons-to-Use-a-Subscription-Model-for-On-Premises-Infrastructure) -Dell Technologies
  * [AI & Healthcare: Truth Behind the Buzz and a Path Forward](https://www.techtarget.com/revcyclemanagement/GreenwayHealth/AI-Healthcare-Truth-Behind-the-Buzz-and-a-Path-Forward) -Greenway Health
  * [See More](https://www.techtarget.com/searchenterpriseai/sponsored_communities)



__Vendor Resources

  * [The Big Book of MLOps](https://www.bitpipe.com/detail/RES/1707715862_872.html) -DataBricks __
  * [The Big Book of Genai 5 Ways to Leverage Your data to build Production-Quality ...](https://www.bitpipe.com/detail/RES/1714715380_11.html) -DataBricks __



Latest TechTarget resources

  * Business Analytics ____
  * CIO ____
  * Data Management ____
  * ERP ____



[ Search Business Analytics](https://www.techtarget.com/searchbusinessanalytics/)

  * __[Data preparation in machine learning: 4 key steps](https://www.techtarget.com/searchbusinessanalytics/feature/Data-preparation-in-machine-learning-6-key-steps)

Data preparation for ML is key to accurate model results. Clean and structure raw data to boost accuracy, improve efficiency, and...

  * __[Sigma Computing launches Data Apps to boost analytics](https://www.techtarget.com/searchbusinessanalytics/news/366620974/Sigma-Computing-launches-Data-Apps-to-boost-analytics)

The vendor's new application development feature enables users to create custom apps that combine data collection, insight ...

  * __[The pros and cons of self-service analytics](https://www.techtarget.com/searchbusinessanalytics/tip/The-pros-and-cons-of-self-service-analytics)

Self-service analytics lowers skill barriers for data use but does require training and financial investment. Evaluate the pros ...




[ Search CIO](https://www.techtarget.com/searchcio/)

  * __[Intel appoints ex-Cadence CEO amid turnaround struggles](https://www.techtarget.com/searchcio/news/366620634/Intel-appoints-ex-Cadence-CEO-amid-turnaround-struggles)

Intel appoints chip industry veteran Lip-Bu Tan as the next CEO responsible for revitalizing the struggling chipmaker and ...

  * __[Trump tariffs raise USMCA trade agreement questions](https://www.techtarget.com/searchcio/news/366620420/Trump-tariffs-raise-USMCA-trade-agreement-questions)

Imposing large tariffs on U.S. allies in the United States-Mexico-Canada Agreement could be a boon for China.

  * __[16 top ERM software vendors to consider in 2025](https://www.techtarget.com/searchcio/feature/Top-ERM-software-vendors-to-consider)

Various software tools can help automate risk management and GRC processes. Here's a look at 16 enterprise risk management ...




[ Search Data Management](https://www.techtarget.com/searchdatamanagement/)

  * __[AWS unifies analytics and AI development in SageMaker](https://www.techtarget.com/searchdatamanagement/news/366620658/AWS-unifies-analytics-and-AI-development-in-SageMaker)

In a move that brings previously disparate analytics and AI development tasks together in one environment with data management, ...

  * __[Vast Data targets secure, speedy agentic AI development](https://www.techtarget.com/searchdatamanagement/news/366620673/Vast-Data-targets-secure-speedy-agentic-AI-development)

The vendor is furthering its expansion into AI development with features such as vector search and event streaming aimed at ...

  * __[New Databricks tools tackle lingering GenAI accuracy issues](https://www.techtarget.com/searchdatamanagement/news/366620484/New-Databricks-tools-tackle-lingering-GenAI-accuracy-issues)

Features such as centralized model governance and real-time monitoring aim to improve the accuracy of outputs so that enterprises...




[ Search ERP](https://www.techtarget.com/searcherp/)

  * __[10 benefits of RFID in supply chain management and logistics](https://www.techtarget.com/searcherp/tip/7-benefits-of-RFID-in-supply-chain-management-and-logistics)

RFID can help companies in their supply chain operations by assisting with product tracking and potentially improving product ...

  * __[Learn the 5 types of digital transformation](https://www.techtarget.com/searcherp/tip/Learn-the-4-types-of-digital-transformation)

A company's business requirements affect which type of digital transformation strategy is most likely to succeed. Learn more ...

  * __[What to include in an RFP for an OMS, with template](https://www.techtarget.com/searcherp/tip/What-to-include-in-an-RFP-for-an-OMS-with-template)

A request for proposal can help save software buying teams time because they receive most, if not all, of the data they'll need ...




  * [About Us](https://www.techtarget.com/editorial/)
  * [Editorial Ethics Policy](https://www.techtarget.com/techtarget-editorial-ethics-policy/)
  * [Meet The Editors](https://www.techtarget.com/editorial-contacts/)
  * [Contact Us](https://www.techtarget.com/contact-us/)
  * [Advertisers](https://www.techtarget.com/for-advertisers/)
  * [Partner with Us](https://www.techtarget.com/partner-with-us/)
  * [Media Kit](https://www.techtarget.com/wp-content/uploads/2023/09/TechTarget-Media-Kit-Handout-with-product-descriptions.pdf)
  * [Corporate Site](https://www.techtarget.com)


  * [Contributors](https://www.techtarget.com/searchenterpriseai/contributors)
  * [Reprints](https://licensing.ygsgroup.com/ygspublishersolutions/)
  * [Answers](https://www.techtarget.com/searchenterpriseai/answers)
  * [Definitions](https://www.techtarget.com/searchenterpriseai/definitions)
  * [E-Products](https://www.techtarget.com/searchenterpriseai/eproducts)
  * [Events](https://www.brighttalk.com/summits)
  * [Features](https://www.techtarget.com/searchenterpriseai/features)


  * [Guides](https://www.techtarget.com/searchenterpriseai/guides)
  * [Opinions](https://www.techtarget.com/searchenterpriseai/opinions)
  * [Photo Stories](https://www.techtarget.com/searchenterpriseai/photostories)
  * [Quizzes](https://www.techtarget.com/searchenterpriseai/quizzes)
  * [Tips](https://www.techtarget.com/searchenterpriseai/tips)
  * [Tutorials](https://www.techtarget.com/searchenterpriseai/tutorials)
  * [Videos](https://www.techtarget.com/searchenterpriseai/videos)



All Rights Reserved,  [Copyright 2018 - 2025](https://www.techtarget.com/searchenterpriseai/about/copyright), TechTarget  
  
[Privacy Policy](https://www.techtarget.com/privacy-policy/)   
Cookie Preferences    
Cookie Preferences    
[Do Not Sell or Share My Personal Information](https://techtarget.zendesk.com/hc/en-us/requests/new?ticket_form_id=360004852434)

Close


url: https://doi.org/https://doi.org/10.18653/v1/2023.acl-tutorials
scrape_date: 2025-03-17T15:29:34.304457
content_type: markdown
hash: 8af2b2d3ce6bc7b11244addaac564f86391ee7dcb1850b30210777fc67c28f0b
title:
Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 6: Tutorial Abstracts) - ACL Anthology

content:
[![ACL Logo](https://aclanthology.org/images/acl-logo.svg) ACL Anthology ](https://aclanthology.org/)

  * [News(current)](/posts/)
  * [FAQ(current)](/faq/)
  * [Corrections(current)](/info/corrections/)
  * [Submissions(current)](/info/contrib/)
  * [__Github](https://github.com/acl-org/acl-anthology/)

__

## [Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 6: Tutorial Abstracts)](https://aclanthology.org/2023.acl-tutorials.pdf)

[Yun-Nung (Vivian) Chen](/people/y/yun-nung-vivian-chen/), [Margot Margot](/people/m/margot-margot/), [Siva Reddy](/people/s/siva-reddy/) (Editors)

* * *

Anthology ID:
    2023.acl-tutorials
Month:
    July
Year:
    2023
Address:
    Toronto, Canada
Venue:
    [ACL](/venues/acl/)
SIG:
    
Publisher:
    Association for Computational Linguistics
URL:
    <https://aclanthology.org/2023.acl-tutorials/>
DOI:
    
Bib Export formats:
    [BibTeX](/volumes/2023.acl-tutorials.bib) [MODS XML](/volumes/2023.acl-tutorials.xml) [EndNote](/volumes/2023.acl-tutorials.endf)
PDF:
    <https://aclanthology.org/2023.acl-tutorials.pdf>

[__PDF  (full) ](https://aclanthology.org/2023.acl-tutorials.pdf "Open PDF of 'Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics \(Volume 6: Tutorial Abstracts\)'")[__Bib TeX ](/volumes/2023.acl-tutorials.bib "Export 'Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics \(Volume 6: Tutorial Abstracts\)' to bib format")[__Search](https://www.semanticscholar.org/search?q=Proceedings+of+the+61st+Annual+Meeting+of+the+Association+for+Computational+Linguistics+%28Volume+6%3A+Tutorial+Abstracts%29 "Search for 'Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics \(Volume 6: Tutorial Abstracts\)' on Semantic Scholar")

* * *

Show all abstracts __Hide all abstracts __

[pdf](https://aclanthology.org/2023.acl-tutorials.0.pdf "Open PDF")[bib](/2023.acl-tutorials.0.bib "Export to BibTeX")  
**[Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 6: Tutorial Abstracts)](/2023.acl-tutorials.0/)**  
[Yun-Nung (Vivian) Chen](/people/y/yun-nung-vivian-chen/) | [Margot Margot](/people/m/margot-margot/) | [Siva Reddy](/people/s/siva-reddy/)

[pdf ](https://aclanthology.org/2023.acl-tutorials.1.pdf "Open PDF")[bib ](/2023.acl-tutorials.1.bib "Export to BibTeX")abs  
**[Goal Awareness for Conversational AI: Proactivity, Non-collaborativity, and Beyond](/2023.acl-tutorials.1/)**  
[Yang Deng](/people/y/yang-deng/) | [Wenqiang Lei](/people/w/wenqiang-lei/) | [Minlie Huang](/people/m/minlie-huang/) | [Tat-Seng Chua](/people/t/tat-seng-chua/)

Conversational systems are envisioned to provide social support or functional service to human users via natural language interactions. Conventional conversation researches mainly focus on the responseability of the system, such as dialogue context understanding and response generation, but overlooks the design of an essential property in intelligent conversations, i.e., goal awareness. The awareness of goals means the state of not only being responsive to the users but also aware of the target conversational goal and capable of leading the conversation towards the goal, which is a significant step towards higher-level intelligence and artificial consciousness. It can not only largely improve user engagement and service efficiency in the conversation, but also empower the system to handle more complicated conversation tasks that involve strategical and motivational interactions. In this tutorial, we will introduce the recent advances on the design of agent’s awareness of goals in a wide range of conversational systems.

[pdf ](https://aclanthology.org/2023.acl-tutorials.2.pdf "Open PDF")[bib ](/2023.acl-tutorials.2.bib "Export to BibTeX")abs  
**[Complex Reasoning in Natural Language](/2023.acl-tutorials.2/)**  
[Wenting Zhao](/people/w/wenting-zhao/) | [Mor Geva](/people/m/mor-geva/) | [Bill Yuchen Lin](/people/b/bill-yuchen-lin/) | [Michihiro Yasunaga](/people/m/michihiro-yasunaga/) | [Aman Madaan](/people/a/aman-madaan/) | [Tao Yu](/people/t/tao-yu/)

Teaching machines to reason over texts has been a long-standing goal of natural language processing (NLP). To this end, researchers have designed a diverse set of complex reasoning tasks that involve compositional reasoning, knowledge retrieval, grounding, commonsense reasoning, etc. A standard choice for building systems that perform a desired type of reasoning is to fine-tune a pretrained language model (LM) on specific downstream tasks. However, recent research has demonstrated that such a straightforward approach is often brittle. For example, Elazar et al. (2021) and Branco et al. (2021) show that, on question-answering (QA) tasks, similar performance can be achieved with questions removed from the inputs. Min et al. (2019), Chen and Durrett (2019), and Tang et al. (2021) show that models trained on multi-hop QA do not generalize to answer single-hop questions. The reasoning capabilities of these models thus remain at a surface level, i.e., exploiting data patterns. Consequently, augmenting LMs with techniques that make them robust and effective becomes an active research area. We will start the tutorial by providing an overview of complex reasoning tasks where the standard application of pretrained language models fails. This tutorial then reviews recent promising directions for tackling these tasks. Specifically, we focus on the following groups of approaches that explicitly consider problem structures: (1) knowledge-augmented methods, where the knowledge is either incorporated during fine-tuning or pretraining; (2) few-shot prompting methods, which effectively guide the models to follow instructions; (3) neuro-symbolic methods, which produce explicit intermediate representations; and, (4) rationale-based methods, one of the most popular forms of the neuro-symbolic methods, which highlight subsets of input as explanations for individual model predictions.

[pdf ](https://aclanthology.org/2023.acl-tutorials.3.pdf "Open PDF")[bib ](/2023.acl-tutorials.3.bib "Export to BibTeX")abs  
**[Everything you need to know about Multilingual LLMs: Towards fair, performant and reliable models for languages of the world](/2023.acl-tutorials.3/)**  
[Sunayana Sitaram](/people/s/sunayana-sitaram/) | [Monojit Choudhury](/people/m/monojit-choudhury/) | [Barun Patra](/people/b/barun-patra/) | [Vishrav Chaudhary](/people/v/vishrav-chaudhary/) | [Kabir Ahuja](/people/k/kabir-ahuja/) | [Kalika Bali](/people/k/kalika-bali/)

This tutorial will describe various aspects of scaling up language technologies to many of the world’s languages by describing the latest research in Massively Multilingual Language Models (MMLMs). We will cover topics such as data collection, training and fine-tuning of models, Responsible AI issues such as fairness, bias and toxicity, linguistic diversity and evaluation in the context of MMLMs, specifically focusing on issues in non-English and low-resource languages. Further, we will also talk about some of the real-world challenges in deploying these models in language communities in the field. With the performance of MMLMs improving in the zero-shot setting for many languages, it is now becoming feasible to use them for building language technologies in many languages of the world, and this tutorial will provide the computational linguistics community with unique insights from the latest research in multilingual models.

[pdf ](https://aclanthology.org/2023.acl-tutorials.4.pdf "Open PDF")[bib ](/2023.acl-tutorials.4.bib "Export to BibTeX")abs  
**[Generating Text from Language Models](/2023.acl-tutorials.4/)**  
[Afra Amini](/people/a/afra-amini/) | [Ryan Cotterell](/people/r/ryan-cotterell/) | [John Hewitt](/people/j/john-hewitt/) | [Luca Malagutti](/people/l/luca-malagutti/) | [Clara Meister](/people/c/clara-meister/) | [Tiago Pimentel](/people/t/tiago-pimentel/)

An increasingly large percentage of natural language processing (NLP) tasks center around the generation of text from probabilistic language models. Despite this trend, techniques for improving or specifying preferences in these generated texts rely mostly on intuition-based heuristics. Further, there lacks a unified presentation of their motivations, practical implementation, successes and pitfalls. Practitioners must, therefore, choose somewhat blindly between generation algorithms—like top-p sampling or beam search—which can lead to wildly different results. At the same time, language generation research continues to criticize and improve the standard toolboxes, further adding entropy to the state of the field. In this tutorial, we will provide a centralized and cohesive discussion of critical considerations when choosing how to generate from a language model. We will cover a wide range of empirically-observed problems (like degradation, hallucination, repetition) and their corresponding proposed algorithmic solutions from recent research (like top-p sampling and its successors). We will then discuss a subset of these algorithms under a unified light; most stochastic generation strategies can be framed as locally adapting the probabilities of a model to avoid failure cases. Finally, we will then cover methods in controlled generation, that go beyond just ensuring coherence to ensure text exhibits specific desired properties. We aim for NLP practitioners and researchers to leave our tutorial with a unified framework which they can use to evaluate and contribute to the latest research in language generation.

[pdf ](https://aclanthology.org/2023.acl-tutorials.5.pdf "Open PDF")[bib ](/2023.acl-tutorials.5.bib "Export to BibTeX")abs  
**[Indirectly Supervised Natural Language Processing](/2023.acl-tutorials.5/)**  
[Wenpeng Yin](/people/w/wenpeng-yin/) | [Muhao Chen](/people/m/muhao-chen/) | [Ben Zhou](/people/b/ben-zhou/) | [Qiang Ning](/people/q/qiang-ning/) | [Kai-Wei Chang](/people/k/kai-wei-chang/) | [Dan Roth](/people/d/dan-roth/)

This tutorial targets researchers and practitioners who are interested in ML technologies for NLP from indirect supervision. In particular, we will present a diverse thread of indirect supervision studies that try to answer the following questions: (i) when and how can we provide supervision for a target task T, if all we have is data that corresponds to a “related” task T′? (ii) humans do not use exhaustive supervision; they rely on occasional feedback, and learn from incidental signals from various sources; how can we effectively incorporate such supervision in machine learning? (iii) how can we leverage multi-modal supervision to help NLP? To the end, we will discuss several lines of research that address those challenges, including (i) indirect supervision from T ′ that handles T with outputs spanning from a moderate size to an open space, (ii) the use of sparsely occurring and incidental signals, such as partial labels, noisy labels, knowledge-based constraints, and cross-domain or cross-task annotations—all having statistical associations with the task, (iii) principled ways to measure and understand why these incidental signals can contribute to our target tasks, and (iv) indirect supervision from vision-language signals. We will conclude the tutorial by outlining directions for further investigation.

[pdf ](https://aclanthology.org/2023.acl-tutorials.6.pdf "Open PDF")[bib ](/2023.acl-tutorials.6.bib "Export to BibTeX")abs  
**[Retrieval-based Language Models and Applications](/2023.acl-tutorials.6/)**  
[Akari Asai](/people/a/akari-asai/) | [Sewon Min](/people/s/sewon-min/) | [Zexuan Zhong](/people/z/zexuan-zhong/) | [Danqi Chen](/people/d/danqi-chen/)

Retrieval-based language models (LMs) have shown impressive performance on diverse NLP tasks. In this tutorial, we will provide a comprehensive and coherent overview of recent advances in retrieval-based LMs. We will start by providing preliminaries covering the foundation of LMs (e.g., masked LMs, autoregressive LMs) and retrieval systems (e.g., nearest-neighbor search). We will then detail recent progress in retrieval-based models, focusing on their model architectures and learning approaches. Finally, we will show how retrieval-based LMs are adapted to downstream applications, and extended to multilingual and multi-modal settings. Finally, we will use an exercise to showcase the effectiveness of retrieval-based LMs.

[![Creative Commons License](https://i.creativecommons.org/l/by/4.0/88x31.png)](http://creativecommons.org/licenses/by/4.0/) ACL materials are Copyright © 1963-2025 ACL; other materials are copyrighted by their respective copyright holders. Materials prior to 2016 here are licensed under the [Creative Commons Attribution-NonCommercial-ShareAlike 3.0 International License](https://creativecommons.org/licenses/by-nc-sa/3.0/). Permission is granted to make copies for the purposes of teaching and research. Materials published in or after 2016 are licensed on a [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/).

The ACL Anthology is managed and built by the [ACL Anthology team](/info/credits/) of volunteers.

_Site last built on 17 March 2025 at 13:08 UTC with[commit b06e0b9](https://github.com/acl-org/acl-anthology/tree/b06e0b905e79097e6196a6b8cda04262e5054af7)._


url: http://arxiv.org/abs/2307.12980v1
title: [2307.12980v1] A Systematic Survey of Prompt Engineering on Vision-Language Foundation Models
scrape_date: 2025-03-17T15:54:52.527642
content_type: markdown
hash: d5a283b6dad37c813515ad1f896b7c84244084c92fc9b4c22c512fa22a0d3a7e
content:
Skip to main content

[![Cornell University](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg)](https://www.cornell.edu/)

We gratefully acknowledge support from the Simons Foundation, [member institutions](https://info.arxiv.org/about/ourmembers.html), and all contributors. [Donate](https://info.arxiv.org/about/donate.html)

[](/IgnoreMe)

[![arxiv logo](/static/browse/0.3.4/images/arxiv-logo-one-color-white.svg)](/) > [cs](/list/cs/recent) > arXiv:2307.12980v1 

[Help](https://info.arxiv.org/help) | [Advanced Search](https://arxiv.org/search/advanced)

All fields Title Author Abstract Comments Journal reference ACM classification MSC classification Report number arXiv identifier DOI ORCID arXiv author ID Help pages Full text

Search

[![arXiv logo](/static/browse/0.3.4/images/arxiv-logomark-small-white.svg)](https://arxiv.org/)

[ ![Cornell University Logo](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg) ](https://www.cornell.edu/)

open search

GO

open navigation menu

## quick links

  * [Login](https://arxiv.org/login)
  * [Help Pages](https://info.arxiv.org/help)
  * [About](https://info.arxiv.org/about)



# Computer Science > Computer Vision and Pattern Recognition

**arXiv:2307.12980v1** (cs) 

[Submitted on 24 Jul 2023]

# Title:A Systematic Survey of Prompt Engineering on Vision-Language Foundation Models

Authors:[Jindong Gu](https://arxiv.org/search/cs?searchtype=author&query=Gu,+J), [Zhen Han](https://arxiv.org/search/cs?searchtype=author&query=Han,+Z), [Shuo Chen](https://arxiv.org/search/cs?searchtype=author&query=Chen,+S), [Ahmad Beirami](https://arxiv.org/search/cs?searchtype=author&query=Beirami,+A), [Bailan He](https://arxiv.org/search/cs?searchtype=author&query=He,+B), [Gengyuan Zhang](https://arxiv.org/search/cs?searchtype=author&query=Zhang,+G), [Ruotong Liao](https://arxiv.org/search/cs?searchtype=author&query=Liao,+R), [Yao Qin](https://arxiv.org/search/cs?searchtype=author&query=Qin,+Y), [Volker Tresp](https://arxiv.org/search/cs?searchtype=author&query=Tresp,+V), [Philip Torr](https://arxiv.org/search/cs?searchtype=author&query=Torr,+P)

View a PDF of the paper titled A Systematic Survey of Prompt Engineering on Vision-Language Foundation Models, by Jindong Gu and 9 other authors

[View PDF](/pdf/2307.12980v1)

> Abstract:Prompt engineering is a technique that involves augmenting a large pre-trained model with task-specific hints, known as prompts, to adapt the model to new tasks. Prompts can be created manually as natural language instructions or generated automatically as either natural language instructions or vector representations. Prompt engineering enables the ability to perform predictions based solely on prompts without updating model parameters, and the easier application of large pre-trained models in real-world tasks. In past years, Prompt engineering has been well-studied in natural language processing. Recently, it has also been intensively studied in vision-language modeling. However, there is currently a lack of a systematic overview of prompt engineering on pre-trained vision-language models. This paper aims to provide a comprehensive survey of cutting-edge research in prompt engineering on three types of vision-language models: multimodal-to-text generation models (e.g. Flamingo), image-text matching models (e.g. CLIP), and text-to-image generation models (e.g. Stable Diffusion). For each type of model, a brief model summary, prompting methods, prompting-based applications, and the corresponding responsibility and integrity issues are summarized and discussed. Furthermore, the commonalities and differences between prompting on vision-language models, language models, and vision models are also discussed. The challenges, future directions, and research opportunities are summarized to foster future research on this topic. 

Subjects: |  Computer Vision and Pattern Recognition (cs.CV)  
---|---  
Cite as: | [arXiv:2307.12980](https://arxiv.org/abs/2307.12980) [cs.CV]  
  | (or  [arXiv:2307.12980v1](https://arxiv.org/abs/2307.12980v1) [cs.CV] for this version)   
  |  <https://doi.org/10.48550/arXiv.2307.12980> Focus to learn more arXiv-issued DOI via DataCite  
  
## Submission history

From: Jindong Gu [[view email](/show-email/e2515162/2307.12980)]   
**[v1]** Mon, 24 Jul 2023 17:58:06 UTC (1,660 KB)  


Full-text links:

## Access Paper:

View a PDF of the paper titled A Systematic Survey of Prompt Engineering on Vision-Language Foundation Models, by Jindong Gu and 9 other authors

  * [View PDF](/pdf/2307.12980v1)
  * [TeX Source](/src/2307.12980v1)
  * [Other Formats](/format/2307.12980v1)



[view license](http://arxiv.org/licenses/nonexclusive-distrib/1.0/ "Rights to this article")

Current browse context: 

cs.CV

[< prev](/prevnext?id=2307.12980&function=prev&context=cs.CV "previous in cs.CV \(accesskey p\)")   |   [next >](/prevnext?id=2307.12980&function=next&context=cs.CV "next in cs.CV \(accesskey n\)")   


[new](/list/cs.CV/new) |  [recent](/list/cs.CV/recent) | [2023-07](/list/cs.CV/2023-07)

Change to browse by: 

[cs](/abs/2307.12980?context=cs)  


### References & Citations

  * [NASA ADS](https://ui.adsabs.harvard.edu/abs/arXiv:2307.12980)
  * [Google Scholar](https://scholar.google.com/scholar_lookup?arxiv_id=2307.12980)
  * [Semantic Scholar](https://api.semanticscholar.org/arXiv:2307.12980)



[a](/static/browse/0.3.4/css/cite.css) export BibTeX citation Loading...

## BibTeX formatted citation

×

loading...

Data provided by: 

### Bookmark

[ ![BibSonomy logo](/static/browse/0.3.4/images/icons/social/bibsonomy.png) ](http://www.bibsonomy.org/BibtexHandler?requTask=upload&url=https://arxiv.org/abs/2307.12980&description=A Systematic Survey of Prompt Engineering on Vision-Language Foundation Models "Bookmark on BibSonomy") [ ![Reddit logo](/static/browse/0.3.4/images/icons/social/reddit.png) ](https://reddit.com/submit?url=https://arxiv.org/abs/2307.12980&title=A Systematic Survey of Prompt Engineering on Vision-Language Foundation Models "Bookmark on Reddit")

Bibliographic Tools

# Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer _([What is the Explorer?](https://info.arxiv.org/labs/showcase.html#arxiv-bibliographic-explorer))_

Connected Papers Toggle

Connected Papers _([What is Connected Papers?](https://www.connectedpapers.com/about))_

Litmaps Toggle

Litmaps _([What is Litmaps?](https://www.litmaps.co/))_

scite.ai Toggle

scite Smart Citations _([What are Smart Citations?](https://www.scite.ai/))_

Code, Data, Media

# Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv _([What is alphaXiv?](https://alphaxiv.org/))_

Links to Code Toggle

CatalyzeX Code Finder for Papers _([What is CatalyzeX?](https://www.catalyzex.com))_

DagsHub Toggle

DagsHub _([What is DagsHub?](https://dagshub.com/))_

GotitPub Toggle

Gotit.pub _([What is GotitPub?](http://gotit.pub/faq))_

Huggingface Toggle

Hugging Face _([What is Huggingface?](https://huggingface.co/huggingface))_

Links to Code Toggle

Papers with Code _([What is Papers with Code?](https://paperswithcode.com/))_

ScienceCast Toggle

ScienceCast _([What is ScienceCast?](https://sciencecast.org/welcome))_

Demos

# Demos

Replicate Toggle

Replicate _([What is Replicate?](https://replicate.com/docs/arxiv/about))_

Spaces Toggle

Hugging Face Spaces _([What is Spaces?](https://huggingface.co/docs/hub/spaces))_

Spaces Toggle

TXYZ.AI _([What is TXYZ.AI?](https://txyz.ai))_

Related Papers

# Recommenders and Search Tools

Link to Influence Flower

Influence Flower _([What are Influence Flowers?](https://influencemap.cmlab.dev/))_

Core recommender toggle

CORE Recommender _([What is CORE?](https://core.ac.uk/services/recommender))_

  * Author
  * Venue
  * Institution
  * Topic



About arXivLabs 

# arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? [**Learn more about arXivLabs**](https://info.arxiv.org/labs/index.html).

[Which authors of this paper are endorsers?](/auth/show-endorsers/2307.12980) | [Disable MathJax](javascript:setMathjaxCookie\(\)) ([What is MathJax?](https://info.arxiv.org/help/mathjax.html)) 

  * [About](https://info.arxiv.org/about)
  * [Help](https://info.arxiv.org/help)



  * contact arXivClick here to contact arXiv [ Contact](https://info.arxiv.org/help/contact.html)
  * subscribe to arXiv mailingsClick here to subscribe [ Subscribe](https://info.arxiv.org/help/subscribe)



  * [Copyright](https://info.arxiv.org/help/license/index.html)
  * [Privacy Policy](https://info.arxiv.org/help/policies/privacy_policy.html)



  * [Web Accessibility Assistance](https://info.arxiv.org/help/web_accessibility.html)
  * [arXiv Operational Status ](https://status.arxiv.org)  
Get status notifications via [email](https://subscribe.sorryapp.com/24846f03/email/new) or [slack](https://subscribe.sorryapp.com/24846f03/slack/new)


url: http://arxiv.org/abs/2311.09773v1
title: [2311.09773v1] To be or not to be? an exploration of continuously controllable prompt engineering
scrape_date: 2025-03-17T15:54:52.527639
content_type: markdown
hash: e72369d4a35295da346c658d082551a19cad9bccada3dd32bcb89d82d9ba15ff
content:
![arXiv smile and hugging face](/static/browse/0.3.4/images/icons/HF-Smiley-Bones-Banner.png)

## Support arXiv on Giving Day with Hugging Face!

Today Hugging Face is TRIPLING your donation to arXiv with a 2:1 match! Give today to keep science open for all.

[**Donate!**](https://givingday.cornell.edu/campaigns/arxiv)

Skip to main content

[![Cornell University](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg)](https://www.cornell.edu/)

We gratefully acknowledge support from the Simons Foundation, [member institutions](https://info.arxiv.org/about/ourmembers.html), and all contributors. [Donate](https://info.arxiv.org/about/donate.html)

[](/IgnoreMe)

[![arxiv logo](/static/browse/0.3.4/images/arxiv-logo-one-color-white.svg)](/) > [cs](/list/cs/recent) > arXiv:2311.09773v1 

[Help](https://info.arxiv.org/help) | [Advanced Search](https://arxiv.org/search/advanced)

All fields Title Author Abstract Comments Journal reference ACM classification MSC classification Report number arXiv identifier DOI ORCID arXiv author ID Help pages Full text

Search

[![arXiv logo](/static/browse/0.3.4/images/arxiv-logomark-small-white.svg)](https://arxiv.org/)

[ ![Cornell University Logo](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg) ](https://www.cornell.edu/)

open search

GO

open navigation menu

## quick links

  * [Login](https://arxiv.org/login)
  * [Help Pages](https://info.arxiv.org/help)
  * [About](https://info.arxiv.org/about)



# Computer Science > Computation and Language

**arXiv:2311.09773v1** (cs) 

[Submitted on 16 Nov 2023]

# Title:To be or not to be? an exploration of continuously controllable prompt engineering

Authors:[Yuhan Sun](https://arxiv.org/search/cs?searchtype=author&query=Sun,+Y), [Mukai Li](https://arxiv.org/search/cs?searchtype=author&query=Li,+M), [Yixin Cao](https://arxiv.org/search/cs?searchtype=author&query=Cao,+Y), [Kun Wang](https://arxiv.org/search/cs?searchtype=author&query=Wang,+K), [Wenxiao Wang](https://arxiv.org/search/cs?searchtype=author&query=Wang,+W), [Xingyu Zeng](https://arxiv.org/search/cs?searchtype=author&query=Zeng,+X), [Rui Zhao](https://arxiv.org/search/cs?searchtype=author&query=Zhao,+R)

View a PDF of the paper titled To be or not to be? an exploration of continuously controllable prompt engineering, by Yuhan Sun and 6 other authors

[View PDF](/pdf/2311.09773v1)

> Abstract:As the use of large language models becomes more widespread, techniques like parameter-efficient fine-tuning and other methods for controlled generation are gaining traction for customizing models and managing their outputs. However, the challenge of precisely controlling how prompts influence these models is an area ripe for further investigation. In response, we introduce ControlPE (Continuously Controllable Prompt Engineering). ControlPE enables finer adjustments to prompt effects, complementing existing prompt engineering, and effectively controls continuous targets. This approach harnesses the power of LoRA (Low-Rank Adaptation) to create an effect akin to prompt weighting, enabling fine-tuned adjustments to the impact of prompts. Our methodology involves generating specialized datasets for prompt distillation, incorporating these prompts into the LoRA model, and carefully adjusting LoRA merging weight to regulate the influence of prompts. This provides a dynamic and adaptable tool for prompt control. Through our experiments, we have validated the practicality and efficacy of ControlPE. It proves to be a promising solution for control a variety of prompts, ranging from generating short responses prompts, refusal prompts to chain-of-thought prompts. 

Subjects: |  Computation and Language (cs.CL)  
---|---  
Cite as: | [arXiv:2311.09773](https://arxiv.org/abs/2311.09773) [cs.CL]  
  | (or  [arXiv:2311.09773v1](https://arxiv.org/abs/2311.09773v1) [cs.CL] for this version)   
  |  <https://doi.org/10.48550/arXiv.2311.09773> Focus to learn more arXiv-issued DOI via DataCite  
  
## Submission history

From: Yuhan Sun [[view email](/show-email/d6a9969b/2311.09773)]   
**[v1]** Thu, 16 Nov 2023 10:55:29 UTC (1,923 KB)  


Full-text links:

## Access Paper:

View a PDF of the paper titled To be or not to be? an exploration of continuously controllable prompt engineering, by Yuhan Sun and 6 other authors

  * [View PDF](/pdf/2311.09773v1)
  * [TeX Source](/src/2311.09773v1)
  * [Other Formats](/format/2311.09773v1)



[ ![license icon](https://arxiv.org/icons/licenses/by-4.0.png) view license ](http://creativecommons.org/licenses/by/4.0/ "Rights to this article")

Current browse context: 

cs.CL

[< prev](/prevnext?id=2311.09773&function=prev&context=cs.CL "previous in cs.CL \(accesskey p\)")   |   [next >](/prevnext?id=2311.09773&function=next&context=cs.CL "next in cs.CL \(accesskey n\)")   


[new](/list/cs.CL/new) |  [recent](/list/cs.CL/recent) | [2023-11](/list/cs.CL/2023-11)

Change to browse by: 

[cs](/abs/2311.09773?context=cs)  


### References & Citations

  * [NASA ADS](https://ui.adsabs.harvard.edu/abs/arXiv:2311.09773)
  * [Google Scholar](https://scholar.google.com/scholar_lookup?arxiv_id=2311.09773)
  * [Semantic Scholar](https://api.semanticscholar.org/arXiv:2311.09773)



[a](/static/browse/0.3.4/css/cite.css) export BibTeX citation Loading...

## BibTeX formatted citation

×

loading...

Data provided by: 

### Bookmark

[ ![BibSonomy logo](/static/browse/0.3.4/images/icons/social/bibsonomy.png) ](http://www.bibsonomy.org/BibtexHandler?requTask=upload&url=https://arxiv.org/abs/2311.09773&description=To be or not to be? an exploration of continuously controllable prompt engineering "Bookmark on BibSonomy") [ ![Reddit logo](/static/browse/0.3.4/images/icons/social/reddit.png) ](https://reddit.com/submit?url=https://arxiv.org/abs/2311.09773&title=To be or not to be? an exploration of continuously controllable prompt engineering "Bookmark on Reddit")

Bibliographic Tools

# Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer _([What is the Explorer?](https://info.arxiv.org/labs/showcase.html#arxiv-bibliographic-explorer))_

Connected Papers Toggle

Connected Papers _([What is Connected Papers?](https://www.connectedpapers.com/about))_

Litmaps Toggle

Litmaps _([What is Litmaps?](https://www.litmaps.co/))_

scite.ai Toggle

scite Smart Citations _([What are Smart Citations?](https://www.scite.ai/))_

Code, Data, Media

# Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv _([What is alphaXiv?](https://alphaxiv.org/))_

Links to Code Toggle

CatalyzeX Code Finder for Papers _([What is CatalyzeX?](https://www.catalyzex.com))_

DagsHub Toggle

DagsHub _([What is DagsHub?](https://dagshub.com/))_

GotitPub Toggle

Gotit.pub _([What is GotitPub?](http://gotit.pub/faq))_

Huggingface Toggle

Hugging Face _([What is Huggingface?](https://huggingface.co/huggingface))_

Links to Code Toggle

Papers with Code _([What is Papers with Code?](https://paperswithcode.com/))_

ScienceCast Toggle

ScienceCast _([What is ScienceCast?](https://sciencecast.org/welcome))_

Demos

# Demos

Replicate Toggle

Replicate _([What is Replicate?](https://replicate.com/docs/arxiv/about))_

Spaces Toggle

Hugging Face Spaces _([What is Spaces?](https://huggingface.co/docs/hub/spaces))_

Spaces Toggle

TXYZ.AI _([What is TXYZ.AI?](https://txyz.ai))_

Related Papers

# Recommenders and Search Tools

Link to Influence Flower

Influence Flower _([What are Influence Flowers?](https://influencemap.cmlab.dev/))_

Core recommender toggle

CORE Recommender _([What is CORE?](https://core.ac.uk/services/recommender))_

  * Author
  * Venue
  * Institution
  * Topic



About arXivLabs 

# arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? [**Learn more about arXivLabs**](https://info.arxiv.org/labs/index.html).

[Which authors of this paper are endorsers?](/auth/show-endorsers/2311.09773) | [Disable MathJax](javascript:setMathjaxCookie\(\)) ([What is MathJax?](https://info.arxiv.org/help/mathjax.html)) 

  * [About](https://info.arxiv.org/about)
  * [Help](https://info.arxiv.org/help)



  * contact arXivClick here to contact arXiv [ Contact](https://info.arxiv.org/help/contact.html)
  * subscribe to arXiv mailingsClick here to subscribe [ Subscribe](https://info.arxiv.org/help/subscribe)



  * [Copyright](https://info.arxiv.org/help/license/index.html)
  * [Privacy Policy](https://info.arxiv.org/help/policies/privacy_policy.html)



  * [Web Accessibility Assistance](https://info.arxiv.org/help/web_accessibility.html)
  * [arXiv Operational Status ](https://status.arxiv.org)  
Get status notifications via [email](https://subscribe.sorryapp.com/24846f03/email/new) or [slack](https://subscribe.sorryapp.com/24846f03/slack/new)


url: http://arxiv.org/abs/2503.05070v1
title: [2503.05070v1] PromptPex: Automatic Test Generation for Language Model Prompts
scrape_date: 2025-03-17T15:54:52.527620
content_type: markdown
hash: 99519a6cd105b7fa672222f2855911dea9d9f9dc781c71f3a5366056d68003cb
content:
Skip to main content

[![Cornell University](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg)](https://www.cornell.edu/)

We gratefully acknowledge support from the Simons Foundation, [member institutions](https://info.arxiv.org/about/ourmembers.html), and all contributors. [Donate](https://info.arxiv.org/about/donate.html)

[](/IgnoreMe)

[![arxiv logo](/static/browse/0.3.4/images/arxiv-logo-one-color-white.svg)](/) > [cs](/list/cs/recent) > arXiv:2503.05070v1 

[Help](https://info.arxiv.org/help) | [Advanced Search](https://arxiv.org/search/advanced)

All fields Title Author Abstract Comments Journal reference ACM classification MSC classification Report number arXiv identifier DOI ORCID arXiv author ID Help pages Full text

Search

[![arXiv logo](/static/browse/0.3.4/images/arxiv-logomark-small-white.svg)](https://arxiv.org/)

[ ![Cornell University Logo](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg) ](https://www.cornell.edu/)

open search

GO

open navigation menu

## quick links

  * [Login](https://arxiv.org/login)
  * [Help Pages](https://info.arxiv.org/help)
  * [About](https://info.arxiv.org/about)



# Computer Science > Software Engineering

**arXiv:2503.05070v1** (cs) 

[Submitted on 7 Mar 2025]

# Title:PromptPex: Automatic Test Generation for Language Model Prompts

Authors:[Reshabh K Sharma](https://arxiv.org/search/cs?searchtype=author&query=Sharma,+R+K), [Jonathan De Halleux](https://arxiv.org/search/cs?searchtype=author&query=De+Halleux,+J), [Shraddha Barke](https://arxiv.org/search/cs?searchtype=author&query=Barke,+S), [Benjamin Zorn](https://arxiv.org/search/cs?searchtype=author&query=Zorn,+B)

View a PDF of the paper titled PromptPex: Automatic Test Generation for Language Model Prompts, by Reshabh K Sharma and 3 other authors

[View PDF](/pdf/2503.05070v1) [HTML (experimental)](https://arxiv.org/html/2503.05070v1)

> Abstract:Large language models (LLMs) are being used in many applications and prompts for these models are integrated into software applications as code-like artifacts. These prompts behave much like traditional software in that they take inputs, generate outputs, and perform some specific function. However, prompts differ from traditional code in many ways and require new approaches to ensure that they are robust. For example, unlike traditional software the output of a prompt depends on the AI model that interprets it. Also, while natural language prompts are easy to modify, the impact of updates is harder to predict. New approaches to testing, debugging, and modifying prompts with respect to the model running them are required.   
> To address some of these issues, we developed PromptPex, an LLM-based tool to automatically generate and evaluate unit tests for a given prompt. PromptPex extracts input and output specifications from a prompt and uses them to generate diverse, targeted, and valid unit tests. These tests are instrumental in identifying regressions when a prompt is changed and also serve as a tool to understand how prompts are interpreted by different models. We use PromptPex to generate tests for eight benchmark prompts and evaluate the quality of the generated tests by seeing if they can cause each of four diverse models to produce invalid output. PromptPex consistently creates tests that result in more invalid model outputs than a carefully constructed baseline LLM-based test generator. Furthermore, by extracting concrete specifications from the input prompt, PromptPex allows prompt writers to clearly understand and test specific aspects of their prompts. The source code of PromptPex is available at [this https URL](https://github.com/microsoft/promptpex). 

Subjects: |  Software Engineering (cs.SE); Artificial Intelligence (cs.AI)  
---|---  
Cite as: | [arXiv:2503.05070](https://arxiv.org/abs/2503.05070) [cs.SE]  
  | (or  [arXiv:2503.05070v1](https://arxiv.org/abs/2503.05070v1) [cs.SE] for this version)   
  |  <https://doi.org/10.48550/arXiv.2503.05070> Focus to learn more arXiv-issued DOI via DataCite  
  
## Submission history

From: Reshabh K Sharma [[view email](/show-email/8e45c621/2503.05070)]   
**[v1]** Fri, 7 Mar 2025 01:31:03 UTC (665 KB)  


Full-text links:

## Access Paper:

View a PDF of the paper titled PromptPex: Automatic Test Generation for Language Model Prompts, by Reshabh K Sharma and 3 other authors

  * [View PDF](/pdf/2503.05070v1)
  * [HTML (experimental)](https://arxiv.org/html/2503.05070v1)
  * [TeX Source](/src/2503.05070v1)
  * [Other Formats](/format/2503.05070v1)



[ ![license icon](https://arxiv.org/icons/licenses/by-4.0.png) view license ](http://creativecommons.org/licenses/by/4.0/ "Rights to this article")

Current browse context: 

cs.SE

[< prev](/prevnext?id=2503.05070&function=prev&context=cs.SE "previous in cs.SE \(accesskey p\)")   |   [next >](/prevnext?id=2503.05070&function=next&context=cs.SE "next in cs.SE \(accesskey n\)")   


[new](/list/cs.SE/new) |  [recent](/list/cs.SE/recent) | [2025-03](/list/cs.SE/2025-03)

Change to browse by: 

[cs](/abs/2503.05070?context=cs)  
[cs.AI](/abs/2503.05070?context=cs.AI)  


### References & Citations

  * [NASA ADS](https://ui.adsabs.harvard.edu/abs/arXiv:2503.05070)
  * [Google Scholar](https://scholar.google.com/scholar_lookup?arxiv_id=2503.05070)
  * [Semantic Scholar](https://api.semanticscholar.org/arXiv:2503.05070)



[a](/static/browse/0.3.4/css/cite.css) export BibTeX citation Loading...

## BibTeX formatted citation

×

loading...

Data provided by: 

### Bookmark

[ ![BibSonomy logo](/static/browse/0.3.4/images/icons/social/bibsonomy.png) ](http://www.bibsonomy.org/BibtexHandler?requTask=upload&url=https://arxiv.org/abs/2503.05070&description=PromptPex: Automatic Test Generation for Language Model Prompts "Bookmark on BibSonomy") [ ![Reddit logo](/static/browse/0.3.4/images/icons/social/reddit.png) ](https://reddit.com/submit?url=https://arxiv.org/abs/2503.05070&title=PromptPex: Automatic Test Generation for Language Model Prompts "Bookmark on Reddit")

Bibliographic Tools

# Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer _([What is the Explorer?](https://info.arxiv.org/labs/showcase.html#arxiv-bibliographic-explorer))_

Connected Papers Toggle

Connected Papers _([What is Connected Papers?](https://www.connectedpapers.com/about))_

Litmaps Toggle

Litmaps _([What is Litmaps?](https://www.litmaps.co/))_

scite.ai Toggle

scite Smart Citations _([What are Smart Citations?](https://www.scite.ai/))_

Code, Data, Media

# Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv _([What is alphaXiv?](https://alphaxiv.org/))_

Links to Code Toggle

CatalyzeX Code Finder for Papers _([What is CatalyzeX?](https://www.catalyzex.com))_

DagsHub Toggle

DagsHub _([What is DagsHub?](https://dagshub.com/))_

GotitPub Toggle

Gotit.pub _([What is GotitPub?](http://gotit.pub/faq))_

Huggingface Toggle

Hugging Face _([What is Huggingface?](https://huggingface.co/huggingface))_

Links to Code Toggle

Papers with Code _([What is Papers with Code?](https://paperswithcode.com/))_

ScienceCast Toggle

ScienceCast _([What is ScienceCast?](https://sciencecast.org/welcome))_

Demos

# Demos

Replicate Toggle

Replicate _([What is Replicate?](https://replicate.com/docs/arxiv/about))_

Spaces Toggle

Hugging Face Spaces _([What is Spaces?](https://huggingface.co/docs/hub/spaces))_

Spaces Toggle

TXYZ.AI _([What is TXYZ.AI?](https://txyz.ai))_

Related Papers

# Recommenders and Search Tools

Link to Influence Flower

Influence Flower _([What are Influence Flowers?](https://influencemap.cmlab.dev/))_

Core recommender toggle

CORE Recommender _([What is CORE?](https://core.ac.uk/services/recommender))_

  * Author
  * Venue
  * Institution
  * Topic



About arXivLabs 

# arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? [**Learn more about arXivLabs**](https://info.arxiv.org/labs/index.html).

[Which authors of this paper are endorsers?](/auth/show-endorsers/2503.05070) | [Disable MathJax](javascript:setMathjaxCookie\(\)) ([What is MathJax?](https://info.arxiv.org/help/mathjax.html)) 

  * [About](https://info.arxiv.org/about)
  * [Help](https://info.arxiv.org/help)



  * contact arXivClick here to contact arXiv [ Contact](https://info.arxiv.org/help/contact.html)
  * subscribe to arXiv mailingsClick here to subscribe [ Subscribe](https://info.arxiv.org/help/subscribe)



  * [Copyright](https://info.arxiv.org/help/license/index.html)
  * [Privacy Policy](https://info.arxiv.org/help/policies/privacy_policy.html)



  * [Web Accessibility Assistance](https://info.arxiv.org/help/web_accessibility.html)
  * [arXiv Operational Status ](https://status.arxiv.org)  
Get status notifications via [email](https://subscribe.sorryapp.com/24846f03/email/new) or [slack](https://subscribe.sorryapp.com/24846f03/slack/new)


url: http://arxiv.org/abs/2302.12173v2
scrape_date: 2025-03-17T15:54:52.527079
content_type: markdown
hash: 8cd298486d9d6379023fcaa548c63dae6aca6e254f546d02bdb1ac8de66031c4
title:
[2302.12173v2] Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection

content:
![arXiv smile and hugging face](/static/browse/0.3.4/images/icons/HF-Smiley-Bones-Banner.png)

## Support arXiv on Giving Day with Hugging Face!

Today Hugging Face is TRIPLING your donation to arXiv with a 2:1 match! Give today to keep science open for all.

[**Donate!**](https://givingday.cornell.edu/campaigns/arxiv)

Skip to main content

[![Cornell University](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg)](https://www.cornell.edu/)

We gratefully acknowledge support from the Simons Foundation, [member institutions](https://info.arxiv.org/about/ourmembers.html), and all contributors. [Donate](https://info.arxiv.org/about/donate.html)

[](/IgnoreMe)

[![arxiv logo](/static/browse/0.3.4/images/arxiv-logo-one-color-white.svg)](/) > [cs](/list/cs/recent) > arXiv:2302.12173v2 

[Help](https://info.arxiv.org/help) | [Advanced Search](https://arxiv.org/search/advanced)

All fields Title Author Abstract Comments Journal reference ACM classification MSC classification Report number arXiv identifier DOI ORCID arXiv author ID Help pages Full text

Search

[![arXiv logo](/static/browse/0.3.4/images/arxiv-logomark-small-white.svg)](https://arxiv.org/)

[ ![Cornell University Logo](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg) ](https://www.cornell.edu/)

open search

GO

open navigation menu

## quick links

  * [Login](https://arxiv.org/login)
  * [Help Pages](https://info.arxiv.org/help)
  * [About](https://info.arxiv.org/about)



# Computer Science > Cryptography and Security

**arXiv:2302.12173v2** (cs) 

[Submitted on 23 Feb 2023 ([v1](https://arxiv.org/abs/2302.12173v1)), last revised 5 May 2023 (this version, v2)]

# Title:Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection

Authors:[Kai Greshake](https://arxiv.org/search/cs?searchtype=author&query=Greshake,+K), [Sahar Abdelnabi](https://arxiv.org/search/cs?searchtype=author&query=Abdelnabi,+S), [Shailesh Mishra](https://arxiv.org/search/cs?searchtype=author&query=Mishra,+S), [Christoph Endres](https://arxiv.org/search/cs?searchtype=author&query=Endres,+C), [Thorsten Holz](https://arxiv.org/search/cs?searchtype=author&query=Holz,+T), [Mario Fritz](https://arxiv.org/search/cs?searchtype=author&query=Fritz,+M)

View a PDF of the paper titled Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection, by Kai Greshake and 5 other authors

[View PDF](/pdf/2302.12173v2)

> Abstract:Large Language Models (LLMs) are increasingly being integrated into various applications. The functionalities of recent LLMs can be flexibly modulated via natural language prompts. This renders them susceptible to targeted adversarial prompting, e.g., Prompt Injection (PI) attacks enable attackers to override original instructions and employed controls. So far, it was assumed that the user is directly prompting the LLM. But, what if it is not the user prompting? We argue that LLM-Integrated Applications blur the line between data and instructions. We reveal new attack vectors, using Indirect Prompt Injection, that enable adversaries to remotely (without a direct interface) exploit LLM-integrated applications by strategically injecting prompts into data likely to be retrieved. We derive a comprehensive taxonomy from a computer security perspective to systematically investigate impacts and vulnerabilities, including data theft, worming, information ecosystem contamination, and other novel security risks. We demonstrate our attacks' practical viability against both real-world systems, such as Bing's GPT-4 powered Chat and code-completion engines, and synthetic applications built on GPT-4. We show how processing retrieved prompts can act as arbitrary code execution, manipulate the application's functionality, and control how and if other APIs are called. Despite the increasing integration and reliance on LLMs, effective mitigations of these emerging threats are currently lacking. By raising awareness of these vulnerabilities and providing key insights into their implications, we aim to promote the safe and responsible deployment of these powerful models and the development of robust defenses that protect users and systems from potential attacks. 

Subjects: |  Cryptography and Security (cs.CR); Artificial Intelligence (cs.AI); Computation and Language (cs.CL); Computers and Society (cs.CY)  
---|---  
Cite as: | [arXiv:2302.12173](https://arxiv.org/abs/2302.12173) [cs.CR]  
  | (or  [arXiv:2302.12173v2](https://arxiv.org/abs/2302.12173v2) [cs.CR] for this version)   
  |  <https://doi.org/10.48550/arXiv.2302.12173> Focus to learn more arXiv-issued DOI via DataCite  
  
## Submission history

From: Sahar Abdelnabi [[view email](/show-email/44a6e5c4/2302.12173)]   
**[[v1]](/abs/2302.12173v1)** Thu, 23 Feb 2023 17:14:38 UTC (5,052 KB)  
**[v2]** Fri, 5 May 2023 14:26:17 UTC (10,831 KB)  


Full-text links:

## Access Paper:

View a PDF of the paper titled Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection, by Kai Greshake and 5 other authors

  * [View PDF](/pdf/2302.12173v2)
  * [TeX Source](/src/2302.12173v2)
  * [Other Formats](/format/2302.12173v2)



[view license](http://arxiv.org/licenses/nonexclusive-distrib/1.0/ "Rights to this article")

Current browse context: 

cs.CR

[< prev](/prevnext?id=2302.12173&function=prev&context=cs.CR "previous in cs.CR \(accesskey p\)")   |   [next >](/prevnext?id=2302.12173&function=next&context=cs.CR "next in cs.CR \(accesskey n\)")   


[new](/list/cs.CR/new) |  [recent](/list/cs.CR/recent) | [2023-02](/list/cs.CR/2023-02)

Change to browse by: 

[cs](/abs/2302.12173?context=cs)  
[cs.AI](/abs/2302.12173?context=cs.AI)  
[cs.CL](/abs/2302.12173?context=cs.CL)  
[cs.CY](/abs/2302.12173?context=cs.CY)  


### References & Citations

  * [NASA ADS](https://ui.adsabs.harvard.edu/abs/arXiv:2302.12173)
  * [Google Scholar](https://scholar.google.com/scholar_lookup?arxiv_id=2302.12173)
  * [Semantic Scholar](https://api.semanticscholar.org/arXiv:2302.12173)



[a](/static/browse/0.3.4/css/cite.css) export BibTeX citation Loading...

## BibTeX formatted citation

×

loading...

Data provided by: 

### Bookmark

[ ![BibSonomy logo](/static/browse/0.3.4/images/icons/social/bibsonomy.png) ](http://www.bibsonomy.org/BibtexHandler?requTask=upload&url=https://arxiv.org/abs/2302.12173&description=Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection "Bookmark on BibSonomy") [ ![Reddit logo](/static/browse/0.3.4/images/icons/social/reddit.png) ](https://reddit.com/submit?url=https://arxiv.org/abs/2302.12173&title=Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection "Bookmark on Reddit")

Bibliographic Tools

# Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer _([What is the Explorer?](https://info.arxiv.org/labs/showcase.html#arxiv-bibliographic-explorer))_

Connected Papers Toggle

Connected Papers _([What is Connected Papers?](https://www.connectedpapers.com/about))_

Litmaps Toggle

Litmaps _([What is Litmaps?](https://www.litmaps.co/))_

scite.ai Toggle

scite Smart Citations _([What are Smart Citations?](https://www.scite.ai/))_

Code, Data, Media

# Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv _([What is alphaXiv?](https://alphaxiv.org/))_

Links to Code Toggle

CatalyzeX Code Finder for Papers _([What is CatalyzeX?](https://www.catalyzex.com))_

DagsHub Toggle

DagsHub _([What is DagsHub?](https://dagshub.com/))_

GotitPub Toggle

Gotit.pub _([What is GotitPub?](http://gotit.pub/faq))_

Huggingface Toggle

Hugging Face _([What is Huggingface?](https://huggingface.co/huggingface))_

Links to Code Toggle

Papers with Code _([What is Papers with Code?](https://paperswithcode.com/))_

ScienceCast Toggle

ScienceCast _([What is ScienceCast?](https://sciencecast.org/welcome))_

Demos

# Demos

Replicate Toggle

Replicate _([What is Replicate?](https://replicate.com/docs/arxiv/about))_

Spaces Toggle

Hugging Face Spaces _([What is Spaces?](https://huggingface.co/docs/hub/spaces))_

Spaces Toggle

TXYZ.AI _([What is TXYZ.AI?](https://txyz.ai))_

Related Papers

# Recommenders and Search Tools

Link to Influence Flower

Influence Flower _([What are Influence Flowers?](https://influencemap.cmlab.dev/))_

Core recommender toggle

CORE Recommender _([What is CORE?](https://core.ac.uk/services/recommender))_

  * Author
  * Venue
  * Institution
  * Topic



About arXivLabs 

# arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? [**Learn more about arXivLabs**](https://info.arxiv.org/labs/index.html).

[Which authors of this paper are endorsers?](/auth/show-endorsers/2302.12173) | [Disable MathJax](javascript:setMathjaxCookie\(\)) ([What is MathJax?](https://info.arxiv.org/help/mathjax.html)) 

  * [About](https://info.arxiv.org/about)
  * [Help](https://info.arxiv.org/help)



  * contact arXivClick here to contact arXiv [ Contact](https://info.arxiv.org/help/contact.html)
  * subscribe to arXiv mailingsClick here to subscribe [ Subscribe](https://info.arxiv.org/help/subscribe)



  * [Copyright](https://info.arxiv.org/help/license/index.html)
  * [Privacy Policy](https://info.arxiv.org/help/policies/privacy_policy.html)



  * [Web Accessibility Assistance](https://info.arxiv.org/help/web_accessibility.html)
  * [arXiv Operational Status ](https://status.arxiv.org)  
Get status notifications via [email](https://subscribe.sorryapp.com/24846f03/email/new) or [slack](https://subscribe.sorryapp.com/24846f03/slack/new)


url: http://arxiv.org/abs/2408.04560v1
title: [2408.04560v1] Conversational Prompt Engineering
scrape_date: 2025-03-17T15:54:52.527628
content_type: markdown
hash: d846a89d32910f3c9082deebf47f8a3dfa3339f365641b388e02a05db75e4563
content:
Skip to main content

[![Cornell University](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg)](https://www.cornell.edu/)

We gratefully acknowledge support from the Simons Foundation, [member institutions](https://info.arxiv.org/about/ourmembers.html), and all contributors. [Donate](https://info.arxiv.org/about/donate.html)

[](/IgnoreMe)

[![arxiv logo](/static/browse/0.3.4/images/arxiv-logo-one-color-white.svg)](/) > [cs](/list/cs/recent) > arXiv:2408.04560v1 

[Help](https://info.arxiv.org/help) | [Advanced Search](https://arxiv.org/search/advanced)

All fields Title Author Abstract Comments Journal reference ACM classification MSC classification Report number arXiv identifier DOI ORCID arXiv author ID Help pages Full text

Search

[![arXiv logo](/static/browse/0.3.4/images/arxiv-logomark-small-white.svg)](https://arxiv.org/)

[ ![Cornell University Logo](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg) ](https://www.cornell.edu/)

open search

GO

open navigation menu

## quick links

  * [Login](https://arxiv.org/login)
  * [Help Pages](https://info.arxiv.org/help)
  * [About](https://info.arxiv.org/about)



# Computer Science > Computation and Language

**arXiv:2408.04560v1** (cs) 

[Submitted on 8 Aug 2024]

# Title:Conversational Prompt Engineering

Authors:[Liat Ein-Dor](https://arxiv.org/search/cs?searchtype=author&query=Ein-Dor,+L), [Orith Toledo-Ronen](https://arxiv.org/search/cs?searchtype=author&query=Toledo-Ronen,+O), [Artem Spector](https://arxiv.org/search/cs?searchtype=author&query=Spector,+A), [Shai Gretz](https://arxiv.org/search/cs?searchtype=author&query=Gretz,+S), [Lena Dankin](https://arxiv.org/search/cs?searchtype=author&query=Dankin,+L), [Alon Halfon](https://arxiv.org/search/cs?searchtype=author&query=Halfon,+A), [Yoav Katz](https://arxiv.org/search/cs?searchtype=author&query=Katz,+Y), [Noam Slonim](https://arxiv.org/search/cs?searchtype=author&query=Slonim,+N)

View a PDF of the paper titled Conversational Prompt Engineering, by Liat Ein-Dor and 7 other authors

[View PDF](/pdf/2408.04560v1) [HTML (experimental)](https://arxiv.org/html/2408.04560v1)

> Abstract:Prompts are how humans communicate with LLMs. Informative prompts are essential for guiding LLMs to produce the desired output. However, prompt engineering is often tedious and time-consuming, requiring significant expertise, limiting its widespread use. We propose Conversational Prompt Engineering (CPE), a user-friendly tool that helps users create personalized prompts for their specific tasks. CPE uses a chat model to briefly interact with users, helping them articulate their output preferences and integrating these into the prompt. The process includes two main stages: first, the model uses user-provided unlabeled data to generate data-driven questions and utilize user responses to shape the initial instruction. Then, the model shares the outputs generated by the instruction and uses user feedback to further refine the instruction and the outputs. The final result is a few-shot prompt, where the outputs approved by the user serve as few-shot examples. A user study on summarization tasks demonstrates the value of CPE in creating personalized, high-performing prompts. The results suggest that the zero-shot prompt obtained is comparable to its - much longer - few-shot counterpart, indicating significant savings in scenarios involving repetitive tasks with large text volumes. 

Subjects: |  Computation and Language (cs.CL)  
---|---  
Cite as: | [arXiv:2408.04560](https://arxiv.org/abs/2408.04560) [cs.CL]  
  | (or  [arXiv:2408.04560v1](https://arxiv.org/abs/2408.04560v1) [cs.CL] for this version)   
  |  <https://doi.org/10.48550/arXiv.2408.04560> Focus to learn more arXiv-issued DOI via DataCite  
  
## Submission history

From: Lena Dankin Mrs. [[view email](/show-email/8b942db6/2408.04560)]   
**[v1]** Thu, 8 Aug 2024 16:18:39 UTC (9,406 KB)  


Full-text links:

## Access Paper:

View a PDF of the paper titled Conversational Prompt Engineering, by Liat Ein-Dor and 7 other authors

  * [View PDF](/pdf/2408.04560v1)
  * [HTML (experimental)](https://arxiv.org/html/2408.04560v1)
  * [TeX Source](/src/2408.04560v1)
  * [Other Formats](/format/2408.04560v1)



[ ![license icon](https://arxiv.org/icons/licenses/by-nc-nd-4.0.png) view license ](http://creativecommons.org/licenses/by-nc-nd/4.0/ "Rights to this article")

Current browse context: 

cs.CL

[< prev](/prevnext?id=2408.04560&function=prev&context=cs.CL "previous in cs.CL \(accesskey p\)")   |   [next >](/prevnext?id=2408.04560&function=next&context=cs.CL "next in cs.CL \(accesskey n\)")   


[new](/list/cs.CL/new) |  [recent](/list/cs.CL/recent) | [2024-08](/list/cs.CL/2024-08)

Change to browse by: 

[cs](/abs/2408.04560?context=cs)  


### References & Citations

  * [NASA ADS](https://ui.adsabs.harvard.edu/abs/arXiv:2408.04560)
  * [Google Scholar](https://scholar.google.com/scholar_lookup?arxiv_id=2408.04560)
  * [Semantic Scholar](https://api.semanticscholar.org/arXiv:2408.04560)



[a](/static/browse/0.3.4/css/cite.css) export BibTeX citation Loading...

## BibTeX formatted citation

×

loading...

Data provided by: 

### Bookmark

[ ![BibSonomy logo](/static/browse/0.3.4/images/icons/social/bibsonomy.png) ](http://www.bibsonomy.org/BibtexHandler?requTask=upload&url=https://arxiv.org/abs/2408.04560&description=Conversational Prompt Engineering "Bookmark on BibSonomy") [ ![Reddit logo](/static/browse/0.3.4/images/icons/social/reddit.png) ](https://reddit.com/submit?url=https://arxiv.org/abs/2408.04560&title=Conversational Prompt Engineering "Bookmark on Reddit")

Bibliographic Tools

# Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer _([What is the Explorer?](https://info.arxiv.org/labs/showcase.html#arxiv-bibliographic-explorer))_

Connected Papers Toggle

Connected Papers _([What is Connected Papers?](https://www.connectedpapers.com/about))_

Litmaps Toggle

Litmaps _([What is Litmaps?](https://www.litmaps.co/))_

scite.ai Toggle

scite Smart Citations _([What are Smart Citations?](https://www.scite.ai/))_

Code, Data, Media

# Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv _([What is alphaXiv?](https://alphaxiv.org/))_

Links to Code Toggle

CatalyzeX Code Finder for Papers _([What is CatalyzeX?](https://www.catalyzex.com))_

DagsHub Toggle

DagsHub _([What is DagsHub?](https://dagshub.com/))_

GotitPub Toggle

Gotit.pub _([What is GotitPub?](http://gotit.pub/faq))_

Huggingface Toggle

Hugging Face _([What is Huggingface?](https://huggingface.co/huggingface))_

Links to Code Toggle

Papers with Code _([What is Papers with Code?](https://paperswithcode.com/))_

ScienceCast Toggle

ScienceCast _([What is ScienceCast?](https://sciencecast.org/welcome))_

Demos

# Demos

Replicate Toggle

Replicate _([What is Replicate?](https://replicate.com/docs/arxiv/about))_

Spaces Toggle

Hugging Face Spaces _([What is Spaces?](https://huggingface.co/docs/hub/spaces))_

Spaces Toggle

TXYZ.AI _([What is TXYZ.AI?](https://txyz.ai))_

Related Papers

# Recommenders and Search Tools

Link to Influence Flower

Influence Flower _([What are Influence Flowers?](https://influencemap.cmlab.dev/))_

Core recommender toggle

CORE Recommender _([What is CORE?](https://core.ac.uk/services/recommender))_

  * Author
  * Venue
  * Institution
  * Topic



About arXivLabs 

# arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? [**Learn more about arXivLabs**](https://info.arxiv.org/labs/index.html).

[Which authors of this paper are endorsers?](/auth/show-endorsers/2408.04560) | [Disable MathJax](javascript:setMathjaxCookie\(\)) ([What is MathJax?](https://info.arxiv.org/help/mathjax.html)) 

  * [About](https://info.arxiv.org/about)
  * [Help](https://info.arxiv.org/help)



  * contact arXivClick here to contact arXiv [ Contact](https://info.arxiv.org/help/contact.html)
  * subscribe to arXiv mailingsClick here to subscribe [ Subscribe](https://info.arxiv.org/help/subscribe)



  * [Copyright](https://info.arxiv.org/help/license/index.html)
  * [Privacy Policy](https://info.arxiv.org/help/policies/privacy_policy.html)



  * [Web Accessibility Assistance](https://info.arxiv.org/help/web_accessibility.html)
  * [arXiv Operational Status ](https://status.arxiv.org)  
Get status notifications via [email](https://subscribe.sorryapp.com/24846f03/email/new) or [slack](https://subscribe.sorryapp.com/24846f03/slack/new)


url: http://arxiv.org/abs/2402.12959v1
title: [2402.12959v1] Prompt Stealing Attacks Against Large Language Models
scrape_date: 2025-03-17T15:54:52.527788
content_type: markdown
hash: bd9056185ccdd08d14f4c0a6266219c40d85d82ca3689cc2fd307b3d25ba4eec
content:
Skip to main content

[![Cornell University](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg)](https://www.cornell.edu/)

We gratefully acknowledge support from the Simons Foundation, [member institutions](https://info.arxiv.org/about/ourmembers.html), and all contributors. [Donate](https://info.arxiv.org/about/donate.html)

[](/IgnoreMe)

[![arxiv logo](/static/browse/0.3.4/images/arxiv-logo-one-color-white.svg)](/) > [cs](/list/cs/recent) > arXiv:2402.12959v1 

[Help](https://info.arxiv.org/help) | [Advanced Search](https://arxiv.org/search/advanced)

All fields Title Author Abstract Comments Journal reference ACM classification MSC classification Report number arXiv identifier DOI ORCID arXiv author ID Help pages Full text

Search

[![arXiv logo](/static/browse/0.3.4/images/arxiv-logomark-small-white.svg)](https://arxiv.org/)

[ ![Cornell University Logo](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg) ](https://www.cornell.edu/)

open search

GO

open navigation menu

## quick links

  * [Login](https://arxiv.org/login)
  * [Help Pages](https://info.arxiv.org/help)
  * [About](https://info.arxiv.org/about)



# Computer Science > Cryptography and Security

**arXiv:2402.12959v1** (cs) 

[Submitted on 20 Feb 2024]

# Title:Prompt Stealing Attacks Against Large Language Models

Authors:[Zeyang Sha](https://arxiv.org/search/cs?searchtype=author&query=Sha,+Z), [Yang Zhang](https://arxiv.org/search/cs?searchtype=author&query=Zhang,+Y)

View a PDF of the paper titled Prompt Stealing Attacks Against Large Language Models, by Zeyang Sha and Yang Zhang

[View PDF](/pdf/2402.12959v1) [HTML (experimental)](https://arxiv.org/html/2402.12959v1)

> Abstract:The increasing reliance on large language models (LLMs) such as ChatGPT in various fields emphasizes the importance of ``prompt engineering,'' a technology to improve the quality of model outputs. With companies investing significantly in expert prompt engineers and educational resources rising to meet market demand, designing high-quality prompts has become an intriguing challenge. In this paper, we propose a novel attack against LLMs, named prompt stealing attacks. Our proposed prompt stealing attack aims to steal these well-designed prompts based on the generated answers. The prompt stealing attack contains two primary modules: the parameter extractor and the prompt reconstruction. The goal of the parameter extractor is to figure out the properties of the original prompts. We first observe that most prompts fall into one of three categories: direct prompt, role-based prompt, and in-context prompt. Our parameter extractor first tries to distinguish the type of prompts based on the generated answers. Then, it can further predict which role or how many contexts are used based on the types of prompts. Following the parameter extractor, the prompt reconstructor can be used to reconstruct the original prompts based on the generated answers and the extracted features. The final goal of the prompt reconstructor is to generate the reversed prompts, which are similar to the original prompts. Our experimental results show the remarkable performance of our proposed attacks. Our proposed attacks add a new dimension to the study of prompt engineering and call for more attention to the security issues on LLMs. 

Subjects: |  Cryptography and Security (cs.CR); Computation and Language (cs.CL)  
---|---  
Cite as: | [arXiv:2402.12959](https://arxiv.org/abs/2402.12959) [cs.CR]  
  | (or  [arXiv:2402.12959v1](https://arxiv.org/abs/2402.12959v1) [cs.CR] for this version)   
  |  <https://doi.org/10.48550/arXiv.2402.12959> Focus to learn more arXiv-issued DOI via DataCite  
  
## Submission history

From: Zeyang Sha [[view email](/show-email/4abbb534/2402.12959)]   
**[v1]** Tue, 20 Feb 2024 12:25:26 UTC (763 KB)  


Full-text links:

## Access Paper:

View a PDF of the paper titled Prompt Stealing Attacks Against Large Language Models, by Zeyang Sha and Yang Zhang

  * [View PDF](/pdf/2402.12959v1)
  * [HTML (experimental)](https://arxiv.org/html/2402.12959v1)
  * [TeX Source](/src/2402.12959v1)
  * [Other Formats](/format/2402.12959v1)



[ ![license icon](https://arxiv.org/icons/licenses/by-4.0.png) view license ](http://creativecommons.org/licenses/by/4.0/ "Rights to this article")

Current browse context: 

cs.CR

[< prev](/prevnext?id=2402.12959&function=prev&context=cs.CR "previous in cs.CR \(accesskey p\)")   |   [next >](/prevnext?id=2402.12959&function=next&context=cs.CR "next in cs.CR \(accesskey n\)")   


[new](/list/cs.CR/new) |  [recent](/list/cs.CR/recent) | [2024-02](/list/cs.CR/2024-02)

Change to browse by: 

[cs](/abs/2402.12959?context=cs)  
[cs.CL](/abs/2402.12959?context=cs.CL)  


### References & Citations

  * [NASA ADS](https://ui.adsabs.harvard.edu/abs/arXiv:2402.12959)
  * [Google Scholar](https://scholar.google.com/scholar_lookup?arxiv_id=2402.12959)
  * [Semantic Scholar](https://api.semanticscholar.org/arXiv:2402.12959)



[a](/static/browse/0.3.4/css/cite.css) export BibTeX citation Loading...

## BibTeX formatted citation

×

loading...

Data provided by: 

### Bookmark

[ ![BibSonomy logo](/static/browse/0.3.4/images/icons/social/bibsonomy.png) ](http://www.bibsonomy.org/BibtexHandler?requTask=upload&url=https://arxiv.org/abs/2402.12959&description=Prompt Stealing Attacks Against Large Language Models "Bookmark on BibSonomy") [ ![Reddit logo](/static/browse/0.3.4/images/icons/social/reddit.png) ](https://reddit.com/submit?url=https://arxiv.org/abs/2402.12959&title=Prompt Stealing Attacks Against Large Language Models "Bookmark on Reddit")

Bibliographic Tools

# Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer _([What is the Explorer?](https://info.arxiv.org/labs/showcase.html#arxiv-bibliographic-explorer))_

Connected Papers Toggle

Connected Papers _([What is Connected Papers?](https://www.connectedpapers.com/about))_

Litmaps Toggle

Litmaps _([What is Litmaps?](https://www.litmaps.co/))_

scite.ai Toggle

scite Smart Citations _([What are Smart Citations?](https://www.scite.ai/))_

Code, Data, Media

# Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv _([What is alphaXiv?](https://alphaxiv.org/))_

Links to Code Toggle

CatalyzeX Code Finder for Papers _([What is CatalyzeX?](https://www.catalyzex.com))_

DagsHub Toggle

DagsHub _([What is DagsHub?](https://dagshub.com/))_

GotitPub Toggle

Gotit.pub _([What is GotitPub?](http://gotit.pub/faq))_

Huggingface Toggle

Hugging Face _([What is Huggingface?](https://huggingface.co/huggingface))_

Links to Code Toggle

Papers with Code _([What is Papers with Code?](https://paperswithcode.com/))_

ScienceCast Toggle

ScienceCast _([What is ScienceCast?](https://sciencecast.org/welcome))_

Demos

# Demos

Replicate Toggle

Replicate _([What is Replicate?](https://replicate.com/docs/arxiv/about))_

Spaces Toggle

Hugging Face Spaces _([What is Spaces?](https://huggingface.co/docs/hub/spaces))_

Spaces Toggle

TXYZ.AI _([What is TXYZ.AI?](https://txyz.ai))_

Related Papers

# Recommenders and Search Tools

Link to Influence Flower

Influence Flower _([What are Influence Flowers?](https://influencemap.cmlab.dev/))_

Core recommender toggle

CORE Recommender _([What is CORE?](https://core.ac.uk/services/recommender))_

  * Author
  * Venue
  * Institution
  * Topic



About arXivLabs 

# arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? [**Learn more about arXivLabs**](https://info.arxiv.org/labs/index.html).

[Which authors of this paper are endorsers?](/auth/show-endorsers/2402.12959) | [Disable MathJax](javascript:setMathjaxCookie\(\)) ([What is MathJax?](https://info.arxiv.org/help/mathjax.html)) 

  * [About](https://info.arxiv.org/about)
  * [Help](https://info.arxiv.org/help)



  * contact arXivClick here to contact arXiv [ Contact](https://info.arxiv.org/help/contact.html)
  * subscribe to arXiv mailingsClick here to subscribe [ Subscribe](https://info.arxiv.org/help/subscribe)



  * [Copyright](https://info.arxiv.org/help/license/index.html)
  * [Privacy Policy](https://info.arxiv.org/help/policies/privacy_policy.html)



  * [Web Accessibility Assistance](https://info.arxiv.org/help/web_accessibility.html)
  * [arXiv Operational Status ](https://status.arxiv.org)  
Get status notifications via [email](https://subscribe.sorryapp.com/24846f03/email/new) or [slack](https://subscribe.sorryapp.com/24846f03/slack/new)


url: http://arxiv.org/abs/2308.11628v1
title: [2308.11628v1] Prompt Engineering For Students of Medicine and Their Teachers
scrape_date: 2025-03-17T15:54:52.527632
content_type: markdown
hash: 4d88e6c15011491a75cebe9ab3f2905e9f4e1bb8b223f841b5f835aa162767dc
content:
Skip to main content

[![Cornell University](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg)](https://www.cornell.edu/)

We gratefully acknowledge support from the Simons Foundation, [member institutions](https://info.arxiv.org/about/ourmembers.html), and all contributors. [Donate](https://info.arxiv.org/about/donate.html)

[](/IgnoreMe)

[![arxiv logo](/static/browse/0.3.4/images/arxiv-logo-one-color-white.svg)](/) > [cs](/list/cs/recent) > arXiv:2308.11628v1 

[Help](https://info.arxiv.org/help) | [Advanced Search](https://arxiv.org/search/advanced)

All fields Title Author Abstract Comments Journal reference ACM classification MSC classification Report number arXiv identifier DOI ORCID arXiv author ID Help pages Full text

Search

[![arXiv logo](/static/browse/0.3.4/images/arxiv-logomark-small-white.svg)](https://arxiv.org/)

[ ![Cornell University Logo](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg) ](https://www.cornell.edu/)

open search

GO

open navigation menu

## quick links

  * [Login](https://arxiv.org/login)
  * [Help Pages](https://info.arxiv.org/help)
  * [About](https://info.arxiv.org/about)



# Computer Science > Human-Computer Interaction

**arXiv:2308.11628v1** (cs) 

[Submitted on 8 Aug 2023]

# Title:Prompt Engineering For Students of Medicine and Their Teachers

Authors:[Thomas F. Heston](https://arxiv.org/search/cs?searchtype=author&query=Heston,+T+F)

View a PDF of the paper titled Prompt Engineering For Students of Medicine and Their Teachers, by Thomas F. Heston

[View PDF](/pdf/2308.11628v1)

> Abstract:"Prompt Engineering for Students of Medicine and Their Teachers" brings the principles of prompt engineering for large language models such as ChatGPT and Google Bard to medical education. This book contains a comprehensive guide to prompt engineering to help both teachers and students improve education in the medical field. Just as prompt engineering is critical in getting good information out of an AI, it is also critical to get students to think and understand more deeply. The principles of prompt engineering that we have learned from AI systems have the potential to simultaneously revolutionize learning in the healthcare field. The book analyzes from multiple angles the anatomy of a good prompt for both AI models and students. The different types of prompts are examined, showing how each style has unique characteristics and applications. The principles of prompt engineering, applied properly, are demonstrated to be effective in teaching across the diverse fields of anatomy, physiology, pathology, pharmacology, and clinical skills. Just like ChatGPT and similar large language AI models, students need clear and detailed prompting in order for them to fully understand a topic. Using identical principles, a prompt that gets good information from an AI will also cause a student to think more deeply and accurately. The process of prompt engineering facilitates this process. Because each chapter contains multiple examples and key takeaways, it is a practical guide for implementing prompt engineering in the learning process. It provides a hands-on approach to ensure readers can immediately apply the concepts they learn 

Subjects: |  Human-Computer Interaction (cs.HC)  
---|---  
Cite as: | [arXiv:2308.11628](https://arxiv.org/abs/2308.11628) [cs.HC]  
  | (or  [arXiv:2308.11628v1](https://arxiv.org/abs/2308.11628v1) [cs.HC] for this version)   
  |  <https://doi.org/10.48550/arXiv.2308.11628> Focus to learn more arXiv-issued DOI via DataCite  
  
## Submission history

From: Thomas Heston [[view email](/show-email/7eaa82b6/2308.11628)]   
**[v1]** Tue, 8 Aug 2023 20:47:16 UTC (440 KB)  


Full-text links:

## Access Paper:

View a PDF of the paper titled Prompt Engineering For Students of Medicine and Their Teachers, by Thomas F. Heston

  * [View PDF](/pdf/2308.11628v1)
  * [Other Formats](/format/2308.11628v1)



[ ![license icon](https://arxiv.org/icons/licenses/by-nc-nd-4.0.png) view license ](http://creativecommons.org/licenses/by-nc-nd/4.0/ "Rights to this article")

Current browse context: 

cs.HC

[< prev](/prevnext?id=2308.11628&function=prev&context=cs.HC "previous in cs.HC \(accesskey p\)")   |   [next >](/prevnext?id=2308.11628&function=next&context=cs.HC "next in cs.HC \(accesskey n\)")   


[new](/list/cs.HC/new) |  [recent](/list/cs.HC/recent) | [2023-08](/list/cs.HC/2023-08)

Change to browse by: 

[cs](/abs/2308.11628?context=cs)  


### References & Citations

  * [NASA ADS](https://ui.adsabs.harvard.edu/abs/arXiv:2308.11628)
  * [Google Scholar](https://scholar.google.com/scholar_lookup?arxiv_id=2308.11628)
  * [Semantic Scholar](https://api.semanticscholar.org/arXiv:2308.11628)



[a](/static/browse/0.3.4/css/cite.css) export BibTeX citation Loading...

## BibTeX formatted citation

×

loading...

Data provided by: 

### Bookmark

[ ![BibSonomy logo](/static/browse/0.3.4/images/icons/social/bibsonomy.png) ](http://www.bibsonomy.org/BibtexHandler?requTask=upload&url=https://arxiv.org/abs/2308.11628&description=Prompt Engineering For Students of Medicine and Their Teachers "Bookmark on BibSonomy") [ ![Reddit logo](/static/browse/0.3.4/images/icons/social/reddit.png) ](https://reddit.com/submit?url=https://arxiv.org/abs/2308.11628&title=Prompt Engineering For Students of Medicine and Their Teachers "Bookmark on Reddit")

Bibliographic Tools

# Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer _([What is the Explorer?](https://info.arxiv.org/labs/showcase.html#arxiv-bibliographic-explorer))_

Connected Papers Toggle

Connected Papers _([What is Connected Papers?](https://www.connectedpapers.com/about))_

Litmaps Toggle

Litmaps _([What is Litmaps?](https://www.litmaps.co/))_

scite.ai Toggle

scite Smart Citations _([What are Smart Citations?](https://www.scite.ai/))_

Code, Data, Media

# Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv _([What is alphaXiv?](https://alphaxiv.org/))_

Links to Code Toggle

CatalyzeX Code Finder for Papers _([What is CatalyzeX?](https://www.catalyzex.com))_

DagsHub Toggle

DagsHub _([What is DagsHub?](https://dagshub.com/))_

GotitPub Toggle

Gotit.pub _([What is GotitPub?](http://gotit.pub/faq))_

Huggingface Toggle

Hugging Face _([What is Huggingface?](https://huggingface.co/huggingface))_

Links to Code Toggle

Papers with Code _([What is Papers with Code?](https://paperswithcode.com/))_

ScienceCast Toggle

ScienceCast _([What is ScienceCast?](https://sciencecast.org/welcome))_

Demos

# Demos

Replicate Toggle

Replicate _([What is Replicate?](https://replicate.com/docs/arxiv/about))_

Spaces Toggle

Hugging Face Spaces _([What is Spaces?](https://huggingface.co/docs/hub/spaces))_

Spaces Toggle

TXYZ.AI _([What is TXYZ.AI?](https://txyz.ai))_

Related Papers

# Recommenders and Search Tools

Link to Influence Flower

Influence Flower _([What are Influence Flowers?](https://influencemap.cmlab.dev/))_

Core recommender toggle

CORE Recommender _([What is CORE?](https://core.ac.uk/services/recommender))_

  * Author
  * Venue
  * Institution
  * Topic



About arXivLabs 

# arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? [**Learn more about arXivLabs**](https://info.arxiv.org/labs/index.html).

[Which authors of this paper are endorsers?](/auth/show-endorsers/2308.11628) | [Disable MathJax](javascript:setMathjaxCookie\(\)) ([What is MathJax?](https://info.arxiv.org/help/mathjax.html)) 

  * [About](https://info.arxiv.org/about)
  * [Help](https://info.arxiv.org/help)



  * contact arXivClick here to contact arXiv [ Contact](https://info.arxiv.org/help/contact.html)
  * subscribe to arXiv mailingsClick here to subscribe [ Subscribe](https://info.arxiv.org/help/subscribe)



  * [Copyright](https://info.arxiv.org/help/license/index.html)
  * [Privacy Policy](https://info.arxiv.org/help/policies/privacy_policy.html)



  * [Web Accessibility Assistance](https://info.arxiv.org/help/web_accessibility.html)
  * [arXiv Operational Status ](https://status.arxiv.org)  
Get status notifications via [email](https://subscribe.sorryapp.com/24846f03/email/new) or [slack](https://subscribe.sorryapp.com/24846f03/slack/new)


url: http://arxiv.org/abs/2407.12994v2
scrape_date: 2025-03-17T15:54:52.527636
content_type: markdown
hash: 8f32907bb4328e7a98fc1e9f746c57da7f6adb7fa108c0dc6c9564cc252424e0
title:
[2407.12994v2] A Survey of Prompt Engineering Methods in Large Language Models for Different NLP Tasks

content:
![arXiv smile and hugging face](/static/browse/0.3.4/images/icons/HF-Smiley-Bones-Banner.png)

## Support arXiv on Giving Day with Hugging Face!

Today Hugging Face is TRIPLING your donation to arXiv with a 2:1 match! Give today to keep science open for all.

[**Donate!**](https://givingday.cornell.edu/campaigns/arxiv)

Skip to main content

[![Cornell University](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg)](https://www.cornell.edu/)

We gratefully acknowledge support from the Simons Foundation, [member institutions](https://info.arxiv.org/about/ourmembers.html), and all contributors. [Donate](https://info.arxiv.org/about/donate.html)

[](/IgnoreMe)

[![arxiv logo](/static/browse/0.3.4/images/arxiv-logo-one-color-white.svg)](/) > [cs](/list/cs/recent) > arXiv:2407.12994v2 

[Help](https://info.arxiv.org/help) | [Advanced Search](https://arxiv.org/search/advanced)

All fields Title Author Abstract Comments Journal reference ACM classification MSC classification Report number arXiv identifier DOI ORCID arXiv author ID Help pages Full text

Search

[![arXiv logo](/static/browse/0.3.4/images/arxiv-logomark-small-white.svg)](https://arxiv.org/)

[ ![Cornell University Logo](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg) ](https://www.cornell.edu/)

open search

GO

open navigation menu

## quick links

  * [Login](https://arxiv.org/login)
  * [Help Pages](https://info.arxiv.org/help)
  * [About](https://info.arxiv.org/about)



# Computer Science > Computation and Language

**arXiv:2407.12994v2** (cs) 

[Submitted on 17 Jul 2024 ([v1](https://arxiv.org/abs/2407.12994v1)), last revised 24 Jul 2024 (this version, v2)]

# Title:A Survey of Prompt Engineering Methods in Large Language Models for Different NLP Tasks

Authors:[Shubham Vatsal](https://arxiv.org/search/cs?searchtype=author&query=Vatsal,+S), [Harsh Dubey](https://arxiv.org/search/cs?searchtype=author&query=Dubey,+H)

View a PDF of the paper titled A Survey of Prompt Engineering Methods in Large Language Models for Different NLP Tasks, by Shubham Vatsal and Harsh Dubey

[View PDF](/pdf/2407.12994v2) [HTML (experimental)](https://arxiv.org/html/2407.12994v2)

> Abstract:Large language models (LLMs) have shown remarkable performance on many different Natural Language Processing (NLP) tasks. Prompt engineering plays a key role in adding more to the already existing abilities of LLMs to achieve significant performance gains on various NLP tasks. Prompt engineering requires composing natural language instructions called prompts to elicit knowledge from LLMs in a structured way. Unlike previous state-of-the-art (SoTA) models, prompt engineering does not require extensive parameter re-training or fine-tuning based on the given NLP task and thus solely operates on the embedded knowledge of LLMs. Additionally, LLM enthusiasts can intelligently extract LLMs' knowledge through a basic natural language conversational exchange or prompt engineering, allowing more and more people even without deep mathematical machine learning background to experiment with LLMs. With prompt engineering gaining popularity in the last two years, researchers have come up with numerous engineering techniques around designing prompts to improve accuracy of information extraction from the LLMs. In this paper, we summarize different prompting techniques and club them together based on different NLP tasks that they have been used for. We further granularly highlight the performance of these prompting strategies on various datasets belonging to that NLP task, talk about the corresponding LLMs used, present a taxonomy diagram and discuss the possible SoTA for specific datasets. In total, we read and present a survey of 44 research papers which talk about 39 different prompting methods on 29 different NLP tasks of which most of them have been published in the last two years. 

Subjects: |  Computation and Language (cs.CL); Artificial Intelligence (cs.AI)  
---|---  
Cite as: | [arXiv:2407.12994](https://arxiv.org/abs/2407.12994) [cs.CL]  
  | (or  [arXiv:2407.12994v2](https://arxiv.org/abs/2407.12994v2) [cs.CL] for this version)   
  |  <https://doi.org/10.48550/arXiv.2407.12994> Focus to learn more arXiv-issued DOI via DataCite  
  
## Submission history

From: Shubham Vatsal [[view email](/show-email/c4434213/2407.12994)]   
**[[v1]](/abs/2407.12994v1)** Wed, 17 Jul 2024 20:23:19 UTC (87 KB)  
**[v2]** Wed, 24 Jul 2024 03:53:41 UTC (88 KB)  


Full-text links:

## Access Paper:

View a PDF of the paper titled A Survey of Prompt Engineering Methods in Large Language Models for Different NLP Tasks, by Shubham Vatsal and Harsh Dubey

  * [View PDF](/pdf/2407.12994v2)
  * [HTML (experimental)](https://arxiv.org/html/2407.12994v2)
  * [TeX Source](/src/2407.12994v2)
  * [Other Formats](/format/2407.12994v2)



[ ![license icon](https://arxiv.org/icons/licenses/by-nc-sa-4.0.png) view license ](http://creativecommons.org/licenses/by-nc-sa/4.0/ "Rights to this article")

Current browse context: 

cs.CL

[< prev](/prevnext?id=2407.12994&function=prev&context=cs.CL "previous in cs.CL \(accesskey p\)")   |   [next >](/prevnext?id=2407.12994&function=next&context=cs.CL "next in cs.CL \(accesskey n\)")   


[new](/list/cs.CL/new) |  [recent](/list/cs.CL/recent) | [2024-07](/list/cs.CL/2024-07)

Change to browse by: 

[cs](/abs/2407.12994?context=cs)  
[cs.AI](/abs/2407.12994?context=cs.AI)  


### References & Citations

  * [NASA ADS](https://ui.adsabs.harvard.edu/abs/arXiv:2407.12994)
  * [Google Scholar](https://scholar.google.com/scholar_lookup?arxiv_id=2407.12994)
  * [Semantic Scholar](https://api.semanticscholar.org/arXiv:2407.12994)



[a](/static/browse/0.3.4/css/cite.css) export BibTeX citation Loading...

## BibTeX formatted citation

×

loading...

Data provided by: 

### Bookmark

[ ![BibSonomy logo](/static/browse/0.3.4/images/icons/social/bibsonomy.png) ](http://www.bibsonomy.org/BibtexHandler?requTask=upload&url=https://arxiv.org/abs/2407.12994&description=A Survey of Prompt Engineering Methods in Large Language Models for Different NLP Tasks "Bookmark on BibSonomy") [ ![Reddit logo](/static/browse/0.3.4/images/icons/social/reddit.png) ](https://reddit.com/submit?url=https://arxiv.org/abs/2407.12994&title=A Survey of Prompt Engineering Methods in Large Language Models for Different NLP Tasks "Bookmark on Reddit")

Bibliographic Tools

# Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer _([What is the Explorer?](https://info.arxiv.org/labs/showcase.html#arxiv-bibliographic-explorer))_

Connected Papers Toggle

Connected Papers _([What is Connected Papers?](https://www.connectedpapers.com/about))_

Litmaps Toggle

Litmaps _([What is Litmaps?](https://www.litmaps.co/))_

scite.ai Toggle

scite Smart Citations _([What are Smart Citations?](https://www.scite.ai/))_

Code, Data, Media

# Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv _([What is alphaXiv?](https://alphaxiv.org/))_

Links to Code Toggle

CatalyzeX Code Finder for Papers _([What is CatalyzeX?](https://www.catalyzex.com))_

DagsHub Toggle

DagsHub _([What is DagsHub?](https://dagshub.com/))_

GotitPub Toggle

Gotit.pub _([What is GotitPub?](http://gotit.pub/faq))_

Huggingface Toggle

Hugging Face _([What is Huggingface?](https://huggingface.co/huggingface))_

Links to Code Toggle

Papers with Code _([What is Papers with Code?](https://paperswithcode.com/))_

ScienceCast Toggle

ScienceCast _([What is ScienceCast?](https://sciencecast.org/welcome))_

Demos

# Demos

Replicate Toggle

Replicate _([What is Replicate?](https://replicate.com/docs/arxiv/about))_

Spaces Toggle

Hugging Face Spaces _([What is Spaces?](https://huggingface.co/docs/hub/spaces))_

Spaces Toggle

TXYZ.AI _([What is TXYZ.AI?](https://txyz.ai))_

Related Papers

# Recommenders and Search Tools

Link to Influence Flower

Influence Flower _([What are Influence Flowers?](https://influencemap.cmlab.dev/))_

Core recommender toggle

CORE Recommender _([What is CORE?](https://core.ac.uk/services/recommender))_

  * Author
  * Venue
  * Institution
  * Topic



About arXivLabs 

# arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? [**Learn more about arXivLabs**](https://info.arxiv.org/labs/index.html).

[Which authors of this paper are endorsers?](/auth/show-endorsers/2407.12994) | [Disable MathJax](javascript:setMathjaxCookie\(\)) ([What is MathJax?](https://info.arxiv.org/help/mathjax.html)) 

  * [About](https://info.arxiv.org/about)
  * [Help](https://info.arxiv.org/help)



  * contact arXivClick here to contact arXiv [ Contact](https://info.arxiv.org/help/contact.html)
  * subscribe to arXiv mailingsClick here to subscribe [ Subscribe](https://info.arxiv.org/help/subscribe)



  * [Copyright](https://info.arxiv.org/help/license/index.html)
  * [Privacy Policy](https://info.arxiv.org/help/policies/privacy_policy.html)



  * [Web Accessibility Assistance](https://info.arxiv.org/help/web_accessibility.html)
  * [arXiv Operational Status ](https://status.arxiv.org)  
Get status notifications via [email](https://subscribe.sorryapp.com/24846f03/email/new) or [slack](https://subscribe.sorryapp.com/24846f03/slack/new)


url: https://doi.org/https://doi.org/10.5121/csit.2023.1322
title: Volume 13 : Number 22 : Computer Science & Information Technology (CS & IT)
scrape_date: 2025-03-17T15:54:52.902280
content_type: markdown
hash: 94e0126268a2a0b002899f45ffe314beebfbb17f8ffd5e15f38bb4e7c17a55ae
content:
  * ![](img/aircc-logo1.jpg)

[AIRCC](index.php) _menu_

  * [Home](https://airccse.org/index.php)
  * [Journals](https://airccse.org/journal.html)
  * [Conferences](https://airccse.org/conference.html)
  * [Submission](https://airccse.org/submission.html)
  * _search_



  * [ _close_ ](index.php) [ ![](img/aircc-logo1.jpg) ](index.php)

#### AIRCC

  * [Home _home_ ](https://airccse.org/index.php)
  * [Journals __](https://airccse.org/journal.html)
  * [Conferences __](https://airccse.org/conference.html)
  * [Submission __](https://airccse.org/submission.html)
  * _search_ Search 



×

_search_

##### Computer Science & Information   
Technology (CS & IT) 

###### ISSN : 2231 - 5403

###### **Volume 13, Number 22, November 2023**

  


######  **13 th International Conference on Artificial Intelligence, Soft Computing and Applications (AIAA 2023), November 25 ~ 26, 2023, London, United Kingdom **

######  Volume Editors : David C. Wyld, Dhinaharan Nagamalai (Eds)

######  ISBN : 978-1-923107-11-3   
  
[Download full Proceedings](http://aircconline.com/csit/csit1322.pdf)

###### **Internet of Things & Embedded Systems**

  


  * ###### [Multimodal Analysis of Google Bard: Experiments in Visual Reasoning ](https://aircconline.com/csit/abstract/v13n22/csit132201.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132201.pdf)

David Noever and Samantha Elizabeth Miller Noever, PeopleTec, Inc., USA 

  


  


  * ###### [A Comprehensive Data-Driven Analysis of Healthcare Disparities in the  
United States ](https://aircconline.com/csit/abstract/v13n22/csit132202.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132202.pdf)

Yusuf Y. Babatunde, Durojaiye M. Olalekan, Yussuph T. Toyyibat, Unuriode O. Austine, Akinwande J. Mayowa, Yusuf K. Tobi and Afolabi T. Osariemen, Austin Peay State University, USA 

  


  


###### **Computer Networks & Data Communications **

  


  * ###### [A Smart Fishing Rod and Software using Flex Sensor, Vibration Sensor and  
Bluetooth ](https://aircconline.com/csit/abstract/v13n22/csit132203.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132203.pdf)

Yanbo Wang1 and Jonathan Sahagun2, 1Chapman University, USA, 2California State Polytechnic University, USA 

  


  


  * ###### [Unravelling DNS Performance: A Historical Examination of F-Root in Southeast Asia ](https://aircconline.com/csit/abstract/v13n22/csit132204.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132204.pdf)

Jiajia Zhu and Chao Qi, China Academy of Information and Communications Technology, China

  


  


  * ###### [Harnessing Mobile Technology for Sustainable Engagement: An Innovative iOS  
and Android Flutter Application for United Nations' SDG Alignment and User  
Empowerment ](https://aircconline.com/csit/abstract/v13n22/csit132205.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132205.pdf)

Megan Wei1 and Bobby Nguyen2, 1University of California Irvine, USA, 2California State Polytechnic University, USA 

  


  


###### **Advances in Computing and Information Technology**

  


  * ###### [An Entertaining Application to Mix Exercise with Fun using Pose Estimate and Unity ](https://aircconline.com/csit/abstract/v13n22/csit132206.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132206.pdf)

Alexander Wu1, Amelia Wu2 and Moddwyn Andaya3, 1California Connections Academy Central Valley, USA, 2UC San Diego, USA, 3California State Polytechnic University, USA 

  


  


  * ###### [ChatGPT for Generating Questions and Assessments based on Accreditations ](https://aircconline.com/csit/abstract/v13n22/csit132207.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132207.pdf)

Rania A Aboalela, King Abdulaziz University, Saudi Arabia

  


  


  * ###### [Assessing the Viability and Socio-Economic Impact of Solar Photovoltaic Systems  
in Off-Grid Rural Communities: A Case Study of a Developing Region ](https://aircconline.com/csit/abstract/v13n22/csit132208.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132208.pdf)

Tianmu Li1 and Jonathan Sahagun2, 1University of California Irvine, USA, 2California  
State Polytechnic University, USA

  


  


###### **Digital Image Processing and Pattern Recognition**

  


  * ###### [A Hierarchical Vision Approach for Enhanced Medical Diagnostics of Lung  
Tuberculosis using Swin Transformer ](https://aircconline.com/csit/abstract/v13n22/csit132209.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132209.pdf)

Syed Amir Hamza and Alexander Jesser, Heilbronn University of Applied Sciences, Germany

  


  


###### **Artificial Intelligence, Soft Computing and Applications**

  


  * ###### [Welcome to Ultaki: Exploring the Relevance of Large Language Models for   
Accurate Behavioral Simulation in Energy Transition ](https://aircconline.com/csit/abstract/v13n22/csit132210.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132210.pdf)

Mehdi Mounsif, Benjamin Jauvion and Fabien Medard, Akkodis Research, France

  


  


  * ###### [Axiomatic Methodology of Formalization as a Way to Intellectual Analysis in  
Computer Science ](https://aircconline.com/csit/abstract/v13n22/csit132211.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132211.pdf)

Viktoria Kondratenko1 and Leonid Slovianov2, 1University of Edinburgh, UK, 2Centre of Innovative Medical Technologies of the National Academy of Sciences of Ukraine, Ukraine 

  


  


  * ###### [From U-Net to (U-Net) +, What Innovations Have We Made for the Treatment and  
Discovery of Breast Cancer? ](https://aircconline.com/csit/abstract/v13n22/csit132212.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132212.pdf)

Minuo Qing, Emily X. Ding and Robert J. Hou, Vineyards AI Lab, New Zealand 

  


  


  * ###### [The AI Transformation Risk Model: Solutions where Benefits Outweigh Risks ](https://aircconline.com/csit/abstract/v13n22/csit132213.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132213.pdf)

Richard Fulton1, Diane Fulton2, Nate Haynes3 and Susan Kaplan3, 1Troy University, USA, 2Clayton State University, USA, 3Modal Technology, USA 

  


  


###### **NLP Techniques and Applications**

  


  * ###### [An Analysis and Research of Growth Factors of Internet Celebrity Boba Milk Tea  
Stores using Machine Learning and Artificial Intelligence ](https://aircconline.com/csit/abstract/v13n22/csit132214.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132214.pdf)

Fuyi Xie1 and Zihao Luo2, 1University of California Irvine, USA, 2California State Polytechnic University, USA 

  


  


  * ###### [Do You Speak Basquenglish? Assessing Low-Resource Multilingual Proficiency of  
Pretrained Language Models ](https://aircconline.com/csit/abstract/v13n22/csit132215.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132215.pdf)

Iñigo Parra, University of Alabama, USA 

  


  


  * ###### [The Evolution of VANET Networks: A Review of Emerging Trends in Artificial Intelligence   
and Software-Defined Networks ](https://aircconline.com/csit/abstract/v13n22/csit132216.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132216.pdf)

Lewys Correa Sánchezl1, Octavio José Salcedo Parra1 and Miguel J. Espitia R.2, 1Universidad Distrital Francisco José de Caldas, Colombia, 2Universidad Distrital Francisco José de Caldas, Colombia

  


  


  * ###### [An Empowering Mobile Aid Application to Help Visually Impaired People Navigate  
and Explore Places Around Them using Location Tracking and Text Detection ](https://aircconline.com/csit/abstract/v13n22/csit132217.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132217.pdf)

Yiyao Zhang1, Anne Yunsheng Zhang1 and Yu Sun2, 1USA, 2California State Polytechnic University, USA

  


  


###### **Web services & Semantic Technology **

  


  * ###### [Advancing Web Accessibility: A Guide to Transitioning Design Systems from WCAG  
2.0 to WCAG 2.1 ](https://aircconline.com/csit/abstract/v13n22/csit132218.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132218.pdf)

Hardik Shah, Rochester Institute of Technology, USA 

  


  


  * ###### [Harnessing Customized Built-in Elements: Empowering Component-Based   
Software Engineering and Design Systems with HTML5 Web Components ](https://aircconline.com/csit/abstract/v13n22/csit132219.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132219.pdf)

Hardik Shah, Rochester Institute of Technology, USA

  


  


###### **Software Security**

  


  * ###### [AI-Based Security Enhancement and Personal Information Protection Techniques  
Inherited from 6G Networks ](https://aircconline.com/csit/abstract/v13n22/csit132220.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132220.pdf)

Kwang-Man Ko, Chul-Long Kim, Jun-Seop Lim, Seong-Won Kim and Byung-Suk Seo, Sangji University, Republic of Korea 

  


  


###### **Advances in Computing and Information Technology**

  


  * ###### [On-premise File Server Vs Cloud Storage with Incident Management: A   
Comparative Study ](https://aircconline.com/csit/abstract/v13n22/csit132221.html)[Full Text](https://aircconline.com/csit/papers/vol13/csit132221.pdf)

Jaymie Rae Medina and Jennalyn Mindoro, Technological Institute of the Philippines, Philippines 

  


  



  * [_account_circle_ Editorial Board](/editorial.html)   

  
  


  

  * [ __Archives](https://airccse.org/arch.html)
  
  


  

  * [ _local_pharmacy_ Indexing](https://airccse.org/indexing.html)
  
  


  

  * [ _home_ CS & IT Home](https://airccse.org/cscp.html)
  
  


  



Conference Proceedings

##### [![](/img/csitn.jpg)](https://www.youtube.com/@computerscienceitconferenc7375)

  * ![since2008](img/since2008.png)



  * [Ethics](ethics.html)
  * [FAQ](faq.html)
  * [Subscription](subscription.html)



  * [Contact](acontact.html)
  * [Sitemap](https://airccse.org/sitemap.html)



  * [ __ ](https://www.facebook.com/AIRCCPC)
  * [ __](https://twitter.com/AIRCCFP)
  * [ __](https://www.youtube.com/channel/UCzkuYvuKuNCIc3jbE52IeZg)



Not for Profit @ All Rights Reserved ® AIRCC 

Designed and Developed by Wireilla Delivery Team


scrape_date: 2025-03-17T15:54:53.421592
content_type: markdown
hash: 3e530b1352ec2abf480cbb78da18889162812d3059841983fb3118e4b9a9d295
url:
https://medium.com/towards-data-science/graph-based-prompting-and-reasoning-with-language-models-d6acbcd6b3d8

title:
Graph-Based Prompting and Reasoning with Language Models | by Cameron R. Wolfe, Ph.D. | TDS Archive | Medium

content:
[Open in app](https://rsci.app.link/?%24canonical_url=https%3A%2F%2Fmedium.com%2Fp%2Fd6acbcd6b3d8&%7Efeature=LoOpenInAppButton&%7Echannel=ShowPostUnderCollection&source=post_page---top_nav_layout_nav-----------------------------------------)

Sign up

[Sign in](/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2Fdata-science%2Fgraph-based-prompting-and-reasoning-with-language-models-d6acbcd6b3d8&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)

[](/?source=post_page---top_nav_layout_nav-----------------------------------------)

[Write](/m/signin?operation=register&redirect=https%3A%2F%2Fmedium.com%2Fnew-story&source=---top_nav_layout_nav-----------------------new_post_topnav------------------)

[](/search?source=post_page---top_nav_layout_nav-----------------------------------------)

Sign up

[Sign in](/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2Fdata-science%2Fgraph-based-prompting-and-reasoning-with-language-models-d6acbcd6b3d8&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)

![](https://miro.medium.com/v2/resize:fill:64:64/1*dmbNkD5D-u45r44go_cf0g.png)

[Home](/?source=post_page--------------------------------------------)[Library](/me/lists?source=post_page--------------------------------------------)

[Stories](/me/stories/drafts?source=post_page--------------------------------------------)[Stats](/me/stats?source=post_page--------------------------------------------)

## [TDS Archive](https://medium.com/data-science?source=post_page---publication_nav-7f60cf5620c9-d6acbcd6b3d8---------------------------------------)

[Home](https://medium.com/data-science?source=post_page---publication_nav-7f60cf5620c9-d6acbcd6b3d8---------------------------------------)[Newsletter](/data-science/newsletter?source=post_page---publication_nav-7f60cf5620c9-d6acbcd6b3d8---------------------------------------)[About](https://medium.com/data-science/about?source=post_page---publication_nav-7f60cf5620c9-d6acbcd6b3d8---------------------------------------)

·

[![TDS Archive](https://miro.medium.com/v2/resize:fill:76:76/1*JEuS4KBdakUcjg9sC7Wo4A.png)](https://medium.com/data-science?source=post_page---post_publication_sidebar-7f60cf5620c9-d6acbcd6b3d8---------------------------------------)

An archive of data science, data analytics, data engineering, machine learning, and artificial…

Member-only story

# Graph-Based Prompting and Reasoning with Language Models

## Understanding graph of thoughts prompting and several variants…

[![Cameron R. Wolfe, Ph.D.](https://miro.medium.com/v2/resize:fill:88:88/1*JhmKo3dvmoRoEfnoU02oSQ.jpeg)](/@wolfecameron?source=post_page---byline--d6acbcd6b3d8---------------------------------------)

[![TDS Archive](https://miro.medium.com/v2/resize:fill:48:48/1*JEuS4KBdakUcjg9sC7Wo4A.png)](https://medium.com/data-science?source=post_page---byline--d6acbcd6b3d8---------------------------------------)

[Cameron R. Wolfe, Ph.D.](/@wolfecameron?source=post_page---byline--d6acbcd6b3d8---------------------------------------)

·

[Follow](/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fsubscribe%2Fuser%2F28aa6026c553&operation=register&redirect=https%3A%2F%2Fmedium.com%2Fdata-science%2Fgraph-based-prompting-and-reasoning-with-language-models-d6acbcd6b3d8&user=Cameron+R.+Wolfe%2C+Ph.D.&userId=28aa6026c553&source=post_page-28aa6026c553--byline--d6acbcd6b3d8---------------------post_header------------------)

Published in

[TDS Archive](https://medium.com/data-science?source=post_page---byline--d6acbcd6b3d8---------------------------------------)

·

22 min read

·

Jan 3, 2024

[](/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fvote%2Fdata-science%2Fd6acbcd6b3d8&operation=register&redirect=https%3A%2F%2Fmedium.com%2Fdata-science%2Fgraph-based-prompting-and-reasoning-with-language-models-d6acbcd6b3d8&user=Cameron+R.+Wolfe%2C+Ph.D.&userId=28aa6026c553&source=---header_actions--d6acbcd6b3d8---------------------clap_footer------------------)

\--

4

[](/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fbookmark%2Fp%2Fd6acbcd6b3d8&operation=register&redirect=https%3A%2F%2Fmedium.com%2Fdata-science%2Fgraph-based-prompting-and-reasoning-with-language-models-d6acbcd6b3d8&source=---header_actions--d6acbcd6b3d8---------------------bookmark_footer------------------)

Share

(Photo by [Alina Grubnyak](https://unsplash.com/@alinnnaaaa?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash) on [Unsplash](https://unsplash.com/photos/low-angle-photography-of-metal-structure-ZiQkhI7417A?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash))

Advanced prompting techniques like chain of thought [8] and tree of thought [9] prompting have drastically improved the ability of large language models (LLMs) to solve complex, reasoning-based tasks. At a high level, forcing the LLM to construct a step-by-step response to a problem drastically improves its problem-solving capabilities. However, all of such techniques assume that the reasoning process should follow a linear patterns that progresses from one thought to the next. Notably, the reasoning process followed by humans tends to be quite different, following multiple different chains of thought and even combining insights from different thoughts to arrive at a final solution. Within this overview, we will be studying several prompting techniques that model the reasoning process as a graph structure — rather than a chain or tree — that better captures the various types of non-linear patterns that may occur when reasoning over a problem.

> “Human thinking is often characterized by its ability to make sudden leaps and connections between seemingly unrelated ideas, which can lead to novel insights and solutions. This non-linear, jumping thought process is a hallmark of human creativity, reasoning, and problem-solving…

[](/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fvote%2Fdata-science%2Fd6acbcd6b3d8&operation=register&redirect=https%3A%2F%2Fmedium.com%2Fdata-science%2Fgraph-based-prompting-and-reasoning-with-language-models-d6acbcd6b3d8&user=Cameron+R.+Wolfe%2C+Ph.D.&userId=28aa6026c553&source=---footer_actions--d6acbcd6b3d8---------------------clap_footer------------------)

\--

[](/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fvote%2Fdata-science%2Fd6acbcd6b3d8&operation=register&redirect=https%3A%2F%2Fmedium.com%2Fdata-science%2Fgraph-based-prompting-and-reasoning-with-language-models-d6acbcd6b3d8&user=Cameron+R.+Wolfe%2C+Ph.D.&userId=28aa6026c553&source=---footer_actions--d6acbcd6b3d8---------------------clap_footer------------------)

\--

4

[](/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fbookmark%2Fp%2Fd6acbcd6b3d8&operation=register&redirect=https%3A%2F%2Fmedium.com%2Fdata-science%2Fgraph-based-prompting-and-reasoning-with-language-models-d6acbcd6b3d8&source=---footer_actions--d6acbcd6b3d8---------------------bookmark_footer------------------)

[![TDS Archive](https://miro.medium.com/v2/resize:fill:96:96/1*JEuS4KBdakUcjg9sC7Wo4A.png)](https://medium.com/data-science?source=post_page---post_publication_info--d6acbcd6b3d8---------------------------------------)

[![TDS Archive](https://miro.medium.com/v2/resize:fill:128:128/1*JEuS4KBdakUcjg9sC7Wo4A.png)](https://medium.com/data-science?source=post_page---post_publication_info--d6acbcd6b3d8---------------------------------------)

## [Published in TDS Archive](https://medium.com/data-science?source=post_page---post_publication_info--d6acbcd6b3d8---------------------------------------)

[811K Followers](/data-science/followers?source=post_page---post_publication_info--d6acbcd6b3d8---------------------------------------)

·[Last published Feb 3, 2025](/data-science/diy-ai-how-to-build-a-linear-regression-model-from-scratch-7b4cc0efd235?source=post_page---post_publication_info--d6acbcd6b3d8---------------------------------------)

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

[![Cameron R. Wolfe, Ph.D.](https://miro.medium.com/v2/resize:fill:96:96/1*JhmKo3dvmoRoEfnoU02oSQ.jpeg)](/@wolfecameron?source=post_page---post_author_info--d6acbcd6b3d8---------------------------------------)

[![Cameron R. Wolfe, Ph.D.](https://miro.medium.com/v2/resize:fill:128:128/1*JhmKo3dvmoRoEfnoU02oSQ.jpeg)](/@wolfecameron?source=post_page---post_author_info--d6acbcd6b3d8---------------------------------------)

Follow

## [Written by Cameron R. Wolfe, Ph.D.](/@wolfecameron?source=post_page---post_author_info--d6acbcd6b3d8---------------------------------------)

[5K Followers](/@wolfecameron/followers?source=post_page---post_author_info--d6acbcd6b3d8---------------------------------------)

·[8 Following](/@wolfecameron/following?source=post_page---post_author_info--d6acbcd6b3d8---------------------------------------)

Director of AI @ Rebuy • Deep Learning Ph.D. • I make AI understandable

Follow

## Responses (4)

[](https://policy.medium.com/medium-rules-30e5502c4eb4?source=post_page---post_responses--d6acbcd6b3d8---------------------------------------)

See all responses

[Help](https://help.medium.com/hc/en-us?source=post_page-----d6acbcd6b3d8---------------------------------------)

[Status](https://medium.statuspage.io/?source=post_page-----d6acbcd6b3d8---------------------------------------)

[About](/about?autoplay=1&source=post_page-----d6acbcd6b3d8---------------------------------------)

[Careers](/jobs-at-medium/work-at-medium-959d1a85284e?source=post_page-----d6acbcd6b3d8---------------------------------------)

[Press](mailto:pressinquiries@medium.com)

[Blog](https://blog.medium.com/?source=post_page-----d6acbcd6b3d8---------------------------------------)

[Privacy](https://policy.medium.com/medium-privacy-policy-f03bf92035c9?source=post_page-----d6acbcd6b3d8---------------------------------------)

[Terms](https://policy.medium.com/medium-terms-of-service-9db0094a1e0f?source=post_page-----d6acbcd6b3d8---------------------------------------)

[Text to speech](https://speechify.com/medium?source=post_page-----d6acbcd6b3d8---------------------------------------)

[Teams](/business?source=post_page-----d6acbcd6b3d8---------------------------------------)


url: https://doi.org/https://doi.org/10.31219/osf.io/ac4sp
title: OSF
scrape_date: 2025-03-17T15:54:53.421727
content_type: markdown
hash: c4a706c1265523a4dcac6be2ddc1394a61a059e3e34d07ab9aa1079cdcdef794
content:
For full functionality of this site it is necessary to enable JavaScript. Here are [ instructions for enabling JavaScript in your web browser](https://www.enable-javascript.com/). 


title: Prompting Techniques in Large Language Models (LLMs)
scrape_date: 2025-03-17T15:54:53.421691
content_type: markdown
hash: 6831b23dccefe77737695d04fb94ca5ba050e5a807b32b1b85756f46a05c827d
url:
https://www.linkedin.com/pulse/prompting-techniques-large-language-models-llms-pankaj-kumar-yadav-ivcpc

content:
Agree & Join LinkedIn 

By clicking Continue to join or sign in, you agree to LinkedIn’s [User Agreement](/legal/user-agreement?trk=linkedin-tc_auth-button_user-agreement), [Privacy Policy](/legal/privacy-policy?trk=linkedin-tc_auth-button_privacy-policy), and [Cookie Policy](/legal/cookie-policy?trk=linkedin-tc_auth-button_cookie-policy). 

`` `` `` `` `` ``

##  Sign in to view more content 

Create your free account or sign in to continue your search 

Sign in 

##  Welcome back 

`` `` `` `` `` `` `` `` `` ``

Email or phone 

Password 

Show

[Forgot password?](https://www.linkedin.com/uas/request-password-reset?trk=pulse-article_contextual-sign-in-modal_sign-in-modal_forgot_password) Sign in 

or 

By clicking Continue to join or sign in, you agree to LinkedIn’s [User Agreement](/legal/user-agreement?trk=pulse-article_contextual-sign-in-modal_sign-in-modal_auth-button_user-agreement), [Privacy Policy](/legal/privacy-policy?trk=pulse-article_contextual-sign-in-modal_sign-in-modal_auth-button_privacy-policy), and [Cookie Policy](/legal/cookie-policy?trk=pulse-article_contextual-sign-in-modal_sign-in-modal_auth-button_cookie-policy). 

New to LinkedIn? [Join now](https://www.linkedin.com/signup/cold-join?session_redirect=%2Fpulse%2Fprompting-techniques-large-language-models-llms-pankaj-kumar-yadav-ivcpc&trk=pulse-article_contextual-sign-in-modal_sign-in-modal_join-link)

or 

New to LinkedIn? [Join now](https://www.linkedin.com/signup/cold-join?session_redirect=%2Fpulse%2Fprompting-techniques-large-language-models-llms-pankaj-kumar-yadav-ivcpc&trk=pulse-article_contextual-sign-in-modal_join-link)

By clicking Continue to join or sign in, you agree to LinkedIn’s [User Agreement](/legal/user-agreement?trk=linkedin-tc_auth-button_user-agreement), [Privacy Policy](/legal/privacy-policy?trk=linkedin-tc_auth-button_privacy-policy), and [Cookie Policy](/legal/cookie-policy?trk=linkedin-tc_auth-button_cookie-policy). 

`` `` `` `` `` `` `` Skip to main content  [ LinkedIn ](/?trk=article-ssr-frontend-pulse_nav-header-logo)

  * [ Articles  ](https://www.linkedin.com/pulse/topics/home/?trk=article-ssr-frontend-pulse_guest_nav_menu_articles)
  * [ People  ](https://www.linkedin.com/pub/dir/+/+?trk=article-ssr-frontend-pulse_guest_nav_menu_people)
  * [ Learning  ](https://www.linkedin.com/learning/search?trk=article-ssr-frontend-pulse_guest_nav_menu_learning)
  * [ Jobs  ](https://www.linkedin.com/jobs/search?trk=article-ssr-frontend-pulse_guest_nav_menu_jobs)
  * [ Games  ](https://www.linkedin.com/games?trk=article-ssr-frontend-pulse_guest_nav_menu_games)



[ Join now ](https://www.linkedin.com/signup/cold-join?session_redirect=%2Fpulse%2Fprompting-techniques-large-language-models-llms-pankaj-kumar-yadav-ivcpc&trk=article-ssr-frontend-pulse_nav-header-join) [ Sign in ](https://www.linkedin.com/uas/login?session_redirect=%2Fpulse%2Fprompting-techniques-large-language-models-llms-pankaj-kumar-yadav-ivcpc&fromSignIn=true&trk=article-ssr-frontend-pulse_nav-header-signin) [ ](https://www.linkedin.com/uas/login?session_redirect=%2Fpulse%2Fprompting-techniques-large-language-models-llms-pankaj-kumar-yadav-ivcpc&fromSignIn=true&trk=article-ssr-frontend-pulse_nav-header-signin)

`` `` `` ``

# Prompting Techniques in Large Language Models (LLMs)

  * [ Report this article ](/uas/login?session_redirect=https%3A%2F%2Fwww.linkedin.com%2Fpulse%2Fprompting-techniques-large-language-models-llms-pankaj-kumar-yadav-ivcpc&trk=article-ssr-frontend-pulse_ellipsis-menu-semaphore-sign-in-redirect&guestReportContentType=PONCHO_ARTICLE&_f=guest-reporting)



[ Pankaj kumar Yadav  ](https://au.linkedin.com/in/pankaj-kumar-yadav-7a065a9)

###  Pankaj kumar Yadav 

####  Chapter Lead - Software Engineering | AI Enthusiast 

Published May 23, 2024 

[ \+ Follow ](https://www.linkedin.com/signup/cold-join?session_redirect=%2Fpulse%2Fprompting-techniques-large-language-models-llms-pankaj-kumar-yadav-ivcpc&trk=article-ssr-frontend-pulse_publisher-author-card)

### Introduction

Prompting techniques play a crucial role in enhancing the capabilities of Large Language Models (LLMs) by providing structured inputs that guide their responses. These techniques are designed to elicit specific types of responses from LLMs, ranging from simple translations to complex reasoning and decision-making processes. Understanding the different types of prompting techniques and their roles can help users leverage LLMs more effectively in various applications.

### Understanding Prompts

Prompts in LLMs are structured inputs that provide context and instructions for the model to generate a desired output. They can take various forms, such as text, images, or a combination of both, and are designed to guide the model's response in a particular direction. The role of prompts is to help LLMs understand the task at hand and generate relevant and accurate outputs.

### Types of Prompting techniques

### Basic Prompting Techniques

### Zero-shot Prompting

Definition: In zero-shot prompting, the model is asked to perform a task without being provided any examples. The prompt must contain enough information for the model to understand and generate the appropriate response.

Example: Prompt: "Translate the following English sentence to French: 'Hello, how are you?'" Response: "Bonjour, comment ça va?"

In this example, the model translates the sentence directly without any prior examples of translations being provided.

### Few-shot Prompting

Definition: In few-shot prompting, the model is provided with a few examples of the task it is expected to perform. These examples help the model understand the format and type of response needed.

> Results from the paper [https://arxiv.org/abs/2202.12837](https://arxiv.org/abs/2202.12837?trk=article-ssr-frontend-pulse_little-text-block)

Example: Prompt:
    
    
    Translate the following English sentences to French:
    1. "Good morning." -> "Bonjour."
    2. "Thank you." -> "Merci."
    3. "I love you." -> "Je t'aime."
    4. "See you later." -> "À plus tard."
    
    Translate the following English sentence to French:
    5. "Hello, how are you?"
            

Response: "Bonjour, comment ça va?"

In this case, the model is given a few examples of English-to-French translations before being asked to translate the new sentence. These examples help guide the model to produce the correct translation for the new input.

### Reasoning and Thought Process

### Chain-of-Thought (CoT)

Definition: Chain-of-Thought prompting encourages the model to explicitly reason through intermediate steps leading to the final answer. This technique helps improve the model's performance on tasks that require complex reasoning.

Example: Prompt: "If there are 3 apples and you buy 2 more apples, how many apples do you have in total? Explain your reasoning step by step." Response: "First, you have 3 apples. Then, you buy 2 more apples. Adding these together, you get 3 + 2 = 5 apples. So, you have 5 apples in total."

In this example, the model breaks down the addition process into smaller steps to arrive at the final answer.

### Self-Consistency

Definition: Self-Consistency involves generating multiple reasoning paths for a given prompt and selecting the most consistent or common answer among them. This technique helps mitigate errors by relying on the most frequent reasoning outcome.

  


> Courtesy: Original Paper [https://arxiv.org/abs/2203.11171](https://arxiv.org/abs/2203.11171?trk=article-ssr-frontend-pulse_little-text-block)

Example: Prompt: "What is the capital of France?" Model generates multiple responses:

  1. "Paris is the capital of France."
  2. "The capital of France is Paris."
  3. "France's capital city is Paris."



All generated paths lead to "Paris," so the final answer is "Paris."

### Tree of Thoughts

Definition: Tree of Thoughts involves structuring the reasoning process hierarchically, exploring different branches of thought to consider various possibilities and outcomes. This technique helps in handling more complex decision-making tasks.

> Courtesy: Original Paper [https://arxiv.org/abs/2305.10601](https://arxiv.org/abs/2305.10601?trk=article-ssr-frontend-pulse_little-text-block)

Example: Prompt: "Decide the best route for a road trip from New York to Los Angeles." Model generates:

  * Main branches:Northern RouteSub-branches: Scenic view, Longer distanceSouthern RouteSub-branches: Shorter distance, Warmer weather



By evaluating the pros and cons of each sub-branch, the model can determine the most suitable route based on specific preferences (e.g., shorter distance or scenic view).

### Least-to-Most

Definition: Least-to-Most prompting involves breaking down a complex problem into simpler sub-questions and solving each one sequentially. This technique helps in tackling difficult questions by addressing manageable components first.

> Courtesy: Original paper [https://arxiv.org/abs/2205.10625](https://arxiv.org/abs/2205.10625?trk=article-ssr-frontend-pulse_little-text-block)

Example: Prompt: "How can you organize a successful conference?" Model breaks it down into sub-questions:

  1. "How do you choose a conference theme?"
  2. "What are the steps to find and book a venue?"
  3. "How do you promote the conference to potential attendees?"
  4. "What are the necessary preparations for the day of the conference?"



By answering each sub-question, the model provides a comprehensive plan for organizing a successful conference.

These techniques help enhance the model's ability to handle various types of tasks, especially those requiring detailed reasoning and decision-making.

### Knowledge and Information Augmentation

### Advanced Prompting Techniques

### Generate Knowledge

Definition: Generate Knowledge involves using the model to synthesize new information or insights based on given inputs. This technique can help create new content, summaries, or innovative ideas.

> Courtesy: Original paper [https://arxiv.org/pdf/2110.08387.pdf](https://arxiv.org/pdf/2110.08387.pdf?trk=article-ssr-frontend-pulse_little-text-block)

Example: Prompt: "Based on the following text, generate new insights about the impact of remote work on employee productivity: 'Many companies have reported an increase in productivity since shifting to remote work. Employees appreciate the flexibility and reduced commute time, which contribute to higher job satisfaction. However, challenges such as maintaining work-life balance and ensuring effective communication persist.'" Response: "Remote work has not only increased productivity but also fostered a greater sense of autonomy among employees. The flexibility allows individuals to tailor their work schedules to their peak productivity times, potentially leading to more innovative and creative outcomes. Additionally, companies might need to invest in better digital tools and strategies to overcome communication challenges and support a sustainable remote work environment."

In this example, the model generates new insights by combining and elaborating on the provided information.

### Retrieval Augmented Generation (RAG)

Definition: Retrieval Augmented Generation combines the model's generation capabilities with information retrieval from external sources. This technique enhances the model's responses by incorporating up-to-date or domain-specific knowledge.

> In RAG prompts, you can also instruct the model to only answer queries based on retrieved data and this is called "Grounding".

> Courtesy: Original paper [https://arxiv.org/pdf/2005.11401.pdf](https://arxiv.org/pdf/2005.11401.pdf?trk=article-ssr-frontend-pulse_little-text-block)

Example: Prompt: "Write a brief summary about the latest advancements in quantum computing based on context provided below. [CONTEXT_VARIABLE]"

> The CONTEXT_VARIABLE is populated by the application calling the model with data. There are different ways the context can be augmented e.g., VectorDB, Knowledge Graphs, Search results etc. Most of the AI solutions implemented in Enterprise will need some form of RAG.

Response: (using RAG) Final Response: "Recent advancements in quantum computing include the development of more stable qubits, which are essential for maintaining coherence over longer periods. Researchers have also made significant progress in error correction techniques, improving the reliability of quantum computations. Furthermore, there are promising results in quantum algorithms, particularly in optimization and machine learning applications, which could revolutionize fields such as cryptography and drug discovery."

In this example, the model retrieves relevant information and generates a coherent summary based on the latest findings.

### Chaining and Combining Prompts

### Prompt Chaining

Definition: Prompt Chaining involves linking multiple prompts together in a sequence to build a more comprehensive and detailed response. This technique allows the model to tackle complex tasks by breaking them down into manageable steps and chaining the outputs of each step together.

Example: Let's say you want the model to generate a detailed guide on starting a vegetable garden. Instead of a single prompt, you can use a series of chained prompts to build a comprehensive guide.

Prompt Chain:

  1. Prompt: "What are the essential steps to start a vegetable garden?" Response: "1. Choose a location, 2. Prepare the soil, 3. Select the vegetables, 4. Plant the seeds, 5. Water the plants, 6. Maintain the garden."
  2. Prompt: "Explain how to choose a location for a vegetable garden." Response: "Choose a location that receives at least 6-8 hours of sunlight per day, has well-drained soil, and is close to a water source."
  3. Prompt: "Describe how to prepare the soil for a vegetable garden." Response: "Clear the area of weeds and debris, test the soil pH, add compost or organic matter to enrich the soil, and till the soil to a depth of 12 inches."
  4. Prompt: "What are some popular vegetables to plant for beginners?" Response: "Tomatoes, cucumbers, carrots, lettuce, and peppers are popular choices for beginner gardeners because they are relatively easy to grow and maintain."



By chaining these prompts together, you create a detailed guide that covers all the essential aspects of starting a vegetable garden.

### Self-Ask

Definition: Self-Ask involves the model generating follow-up questions for itself based on an initial prompt. This iterative process helps the model refine its understanding and produce a more accurate and detailed response.

> Courtesy: Original paper [https://ofir.io/self-ask.pdf](https://ofir.io/self-ask.pdf?trk=article-ssr-frontend-pulse_little-text-block)

Example: Let's say you want the model to explain the impact of climate change on polar bears. Instead of a single prompt, the model generates and answers follow-up questions to refine its response.

Initial Prompt: "Explain the impact of climate change on polar bears."

Self-Generated Follow-Up Questions and Answers:

  1. Question: "How does climate change affect the habitat of polar bears?" Answer: "Climate change leads to the melting of sea ice, which is the primary habitat for polar bears. Without sufficient sea ice, polar bears have difficulty hunting seals, their main food source."
  2. Question: "What are the consequences of reduced hunting opportunities for polar bears?" Answer: "Reduced hunting opportunities result in malnutrition and lower body condition for polar bears. This can lead to decreased reproductive rates and higher mortality rates, especially for cubs."
  3. Question: "How does climate change impact the polar bear population?" Answer: "The combined effects of habitat loss and reduced hunting success contribute to a decline in the polar bear population. As the sea ice continues to shrink, polar bears are forced to travel greater distances and expend more energy to find food, further exacerbating their decline."



By generating and answering these follow-up questions, the model provides a more comprehensive and detailed explanation of the impact of climate change on polar bears.

These techniques help the model handle complex topics by breaking them down into smaller, manageable parts (Prompt Chaining) or by iteratively refining its understanding through self-generated questions (Self-Ask).

### Advanced Techniques

### Automatic Reasoning and Tool Use

Definition: Automatic Reasoning and Tool Use involves leveraging external tools or resources to assist in complex reasoning tasks. This technique can involve using APIs, databases, or other software tools to perform specific operations that enhance the model's capabilities.

> Courtesy: Original paper [https://arxiv.org/abs/2303.09014](https://arxiv.org/abs/2303.09014?trk=article-ssr-frontend-pulse_little-text-block)

Example: Let's say you want to calculate the trajectory of a satellite. The model can use an external computational tool or API to perform precise calculations.

## Recommended by LinkedIn

[ The Current #7: How AI is Reshaping Translation and… New Enterprise Associates (NEA)  8 months ago  ](https://www.linkedin.com/pulse/current-7-how-ai-reshaping-translation-language-suw5f)

[ Steve Jobs is Resurrected, Meta Is Translating… Lightning AI  2 years ago  ](https://www.linkedin.com/pulse/steve-jobs-resurrected-meta-translating-unwritten-languages-)

[ NMT vs. LLM: Which Translation Technology Suits Your… LanguageLine Solutions  8 months ago  ](https://www.linkedin.com/pulse/nmt-vs-llm-which-translation-technology-suits-your-t4b7c)

Prompt: "Calculate the trajectory of a satellite given its initial velocity and position." Response:

  1. Model: "To calculate the trajectory accurately, I need to use an external tool."
  2. (Model interfaces with an orbital mechanics API or a computational tool to perform the calculation)
  3. Model: "Using the given initial velocity of 7.8 km/s and initial position at a height of 300 km, the satellite's trajectory is calculated to be elliptical with a period of 90 minutes."



In this example, the model leverages an external computational tool to perform the complex task of calculating the satellite's trajectory.

### Automatic Prompt Engineer

Definition: Automatic Prompt Engineer involves the model generating its own prompts for specific tasks, optimizing the prompt based on the requirements and context to achieve the best possible outcome.

> Courtesy: Original paper [https://arxiv.org/abs/2211.01910](https://arxiv.org/abs/2211.01910?trk=article-ssr-frontend-pulse_little-text-block)

Example: Let's say you want to generate a marketing campaign for a new product. The model can create optimized prompts to guide the creation of the campaign.

Initial Prompt: "Create a marketing campaign for a new eco-friendly water bottle." Automatic Prompt Generation Process:

  1. Model: "To create an effective campaign, I need to consider the target audience, key features of the product, and marketing channels. Let's start with defining the target audience."
  2. Generated Prompt: "Who is the target audience for the eco-friendly water bottle?" Response: "The target audience includes environmentally conscious consumers, fitness enthusiasts, and outdoor adventurers."
  3. Generated Prompt: "What are the key features of the eco-friendly water bottle?" Response: "The water bottle is made from recycled materials, BPA-free, and has a built-in filter."
  4. Generated Prompt: "Which marketing channels should we use to reach the target audience?" Response: "We should use social media platforms like Instagram and Facebook, eco-friendly blogs, and fitness magazines."



By generating these intermediate prompts, the model guides the creation of a detailed and focused marketing campaign.

### Directional and Stimulus-Based

### Directional Stimulus

Definition: Directional Stimulus involves guiding the model’s responses by using prompts that provide specific direction or context. This helps steer the model towards producing more focused and relevant outputs.

> Courtesy: Original paper [https://arxiv.org/abs/2302.11520](https://arxiv.org/abs/2302.11520?trk=article-ssr-frontend-pulse_little-text-block)

Example: Let's say you want the model to write a story, but you want to ensure it has a particular theme and setting.

Prompt: "Write a short story set in a post-apocalyptic world where the main character is a scientist searching for a cure to a deadly virus." Response: "In the desolate remains of what was once a thriving city, Dr. Amelia Clarke trudged through the rubble, her mind fixated on a single goal: finding a cure for the virus that had decimated humanity. With each step, she recalled the days before the outbreak, when life was normal and the world was full of hope. Now, she was one of the few remaining scientists, working tirelessly in her makeshift lab, hoping to discover a solution that could save the remnants of humanity."

In this example, the prompt provides a specific direction for the story, ensuring the model generates content that fits the desired theme and setting.

### ReAct (Reasoning and Acting)

Definition: ReAct involves combining reasoning and action in decision-making scenarios. This technique allows the model to not only reason through a problem but also to take specific actions or make decisions based on that reasoning.

> Courtesy: Original paper [https://arxiv.org/abs/2210.03629](https://arxiv.org/abs/2210.03629?trk=article-ssr-frontend-pulse_little-text-block)

Example: Let's say you want the model to assist in planning a trip. The model will reason through the requirements and make decisions accordingly.

Initial Prompt: "Plan a 5-day trip to Tokyo, considering popular attractions, accommodation, and food."

ReAct Process:

  1. Reasoning: "To plan a 5-day trip to Tokyo, I need to consider the best attractions to visit, suitable accommodation, and local food options."
  2. Action: "First, let's list the top attractions in Tokyo."Model generates a list: "1. Tokyo Tower, 2. Senso-ji Temple, 3. Shibuya Crossing, 4. Meiji Shrine, 5. Akihabara"
  3. Reasoning: "Next, I'll find accommodation options near these attractions."
  4. Action: "Based on the proximity to attractions, here are some recommended hotels:"Model lists hotels: "1. The Ritz-Carlton, Tokyo, 2. Park Hyatt Tokyo, 3. Hotel Gracery Shinjuku"
  5. Reasoning: "Now, let's plan for food options."
  6. Action: "For a comprehensive food experience, visit Tsukiji Fish Market for sushi, try ramen in Shinjuku, and enjoy tempura in Asakusa."



Final Itinerary:

  * Day 1: Visit Tokyo Tower and Senso-ji Temple, stay at The Ritz-Carlton, Tokyo.
  * Day 2: Explore Shibuya Crossing and Meiji Shrine, stay at Park Hyatt Tokyo.
  * Day 3: Spend the day in Akihabara, stay at Hotel Gracery Shinjuku.
  * Day 4: Visit Tsukiji Fish Market for sushi breakfast, explore Shinjuku for ramen lunch.
  * Day 5: Enjoy tempura in Asakusa, visit any remaining attractions.



In this example, the model reasons through the trip planning process, makes decisions, and provides a detailed itinerary by combining reasoning and action.

### Multimodal and Program-Aided

### Multimodal Chain-of-Thought (Multimodal CoT)

Definition: Multimodal Chain-of-Thought (CoT) involves incorporating multiple types of data, such as text, images, and other modalities, in the reasoning process. This technique allows the model to leverage different types of information to arrive at a more comprehensive and accurate response.

> Courtesy: Original paper [https://arxiv.org/abs/2302.00923](https://arxiv.org/abs/2302.00923?trk=article-ssr-frontend-pulse_little-text-block)

Example: Let's say you want the model to analyze a piece of art and provide insights into its historical context and artistic style.

Prompt: "Analyze the painting 'Starry Night' by Vincent van Gogh and explain its historical context and artistic style. Here is an image of the painting: [image of 'Starry Night']"

Response:

  1. Image Analysis: The model examines the provided image of 'Starry Night'.Observations: "The painting features swirling patterns in the night sky, with a bright crescent moon and stars. The foreground includes a small village with cypress trees."
  2. Textual Reasoning: The model integrates the visual observations with historical and artistic knowledge.Historical Context: "Vincent van Gogh painted 'Starry Night' in 1889 while he was staying at the Saint-Paul-de-Mausole asylum in Saint-Rémy-de-Provence. This period was marked by his struggles with mental health, which influenced his work."Artistic Style: "The painting is a prime example of Post-Impressionism, characterized by bold colors, dynamic brushstrokes, and an emotional, expressive approach. The swirling sky reflects van Gogh's unique vision and his emotional turmoil during this period."



In this example, the model uses the image of 'Starry Night' along with textual reasoning to provide a detailed analysis that incorporates both visual and historical information.

### Program-Aided Language Models (PALM)

Definition: Program-Aided Language Models (PALM) involve using external programs or tools to assist the language model in performing specific tasks. This technique enhances the model's capabilities by integrating specialized software to handle parts of the task that require precise or complex computations. In most cases, it writes the program itself and executes it with help from a tool like "Code interpreter" and analyses to the result to answer the question.

> Courtesy: Original paper [https://arxiv.org/abs/2211.10435](https://arxiv.org/abs/2211.10435?trk=article-ssr-frontend-pulse_little-text-block)

Example: Let's say you want the model to solve a complex mathematical problem that requires precise calculations.

Prompt: "Calculate the trajectory of a projectile launched at a 45-degree angle with an initial velocity of 20 m/s. Use the gravitational constant g = 9.8 m/s²."

Response:

  1. Reasoning: "To calculate the trajectory, I need to determine the horizontal and vertical components of the motion."
  2. Program Invocation: The model uses an external physics engine, computational tool or code interpreter to perform the necessary calculations and/or execute code.Horizontal Component:Initial velocity (v₀): 20 m/sAngle (θ): 45 degreesHorizontal velocity (vₓ): v₀  cos(θ) = 20  cos(45°) = 20  0.707 ≈ 14.14 m/sVertical Component:Vertical velocity (vᵧ): v₀  sin(θ) = 20  sin(45°) = 20  0.707 ≈ 14.14 m/sTime of flight (T): (2  vᵧ) / g = (2  14.14) / 9.8 ≈ 2.89 secondsMaximum height (H): (vᵧ²) / (2  g) = (14.14²) / (2  9.8) ≈ 10.2 metersHorizontal Distance:Range (R): vₓ  T = 14.14  2.89 ≈ 40.9 meters
  3. Output: The program returns the calculated values to the model."The projectile will reach a maximum height of approximately 10.2 meters and will travel a horizontal distance of approximately 40.9 meters."



In this example, the model relies on an external physics program or Code interpreter to perform accurate calculations for the projectile's trajectory, demonstrating how PALM integrates specialized software to enhance the model's capabilities.

### Reflexive and Reflective

### Reflexion: Iterative Self-Improvement

Definition: Reflexion involves having the model reflect on its own outputs and iteratively improve them. This technique enables the model to review its initial responses, identify potential errors or areas for enhancement, and generate improved versions of its answers.

> Courtesy: Original paper [https://arxiv.org/pdf/2303.11366.pdf](https://arxiv.org/pdf/2303.11366.pdf?trk=article-ssr-frontend-pulse_little-text-block)

Example:

Prompt: "Explain the significance of the Magna Carta in 1215."

Initial Response: "The Magna Carta, signed in 1215, was a charter of rights agreed to by King John of England. It is significant because it limited the power of the king and established certain legal protections for subjects, such as the right to a fair trial and protection against unlawful imprisonment."

Reflexion Process:

  1. Reflection Prompt: "Review the previous explanation and identify any missing details or areas that could be improved."
  2. Model's Reflection:
  3. Improvement Prompt: "Improve the explanation of the Magna Carta by including more details on its historical context, specific clauses, and its long-term impact."
  4. Improved Response: "The Magna Carta, signed in 1215 by King John of England, was a revolutionary document that sought to address the grievances of rebellious barons against the king's abuse of power. It established key principles that limited royal authority and laid the groundwork for modern legal systems. Notable clauses included the protection of church rights, access to swift justice, and limitations on feudal payments to the Crown. The Magna Carta's significance extends beyond its immediate effect; it influenced the development of constitutional law and inspired later documents such as the United States Constitution and the Universal Declaration of Human Rights. Its legacy is seen in the principle that no one, not even the king, is above the law."



Final Reflection:

  1. Reflection Prompt: "Review the improved explanation for clarity and completeness."
  2. Model's Reflection:"The improved response provides a more comprehensive understanding of the Magna Carta, including its historical context, specific clauses, and long-term impact. The additional details make the explanation more informative and insightful."



By reflecting on its initial response and iteratively improving it, the model produces a more thorough and accurate explanation of the Magna Carta's significance. This process demonstrates how Reflexion enables the model to enhance the quality of its outputs through self-review and refinement.

### Graph of Thought: Structuring Reasoning with Graphs

Definition: The Graph of Thought technique involves structuring the reasoning process using a graph where nodes represent pieces of information or concepts, and edges represent the relationships between them. This allows the model to organize and link information in a way that mimics human thought processes, making it easier to explore different reasoning paths and make connections between related ideas.

> Courtesy: Original paper [https://arxiv.org/abs/2308.09687](https://arxiv.org/abs/2308.09687?trk=article-ssr-frontend-pulse_little-text-block)

Example:

Let's say you want the model to explain the factors contributing to climate change and their interrelationships.

Initial Prompt: "Explain the factors contributing to climate change and how they are related."

Graph of Thought Process:

  1. Identify Key Factors:
  2. Establish Relationships:



Constructing the Graph:

  * Node A: Greenhouse Gas Emissions
  * Node B: Deforestation
  * Node C: Industrial Activities
  * Node D: Agriculture
  * Node E: Fossil Fuel Consumption



Edges:

  * A ⇔ E (Greenhouse Gas Emissions and Fossil Fuel Consumption are directly linked)
  * B → A (Deforestation contributes to Greenhouse Gas Emissions)
  * C → A (Industrial Activities contribute to Greenhouse Gas Emissions)
  * D → A (Agriculture contributes to Greenhouse Gas Emissions)
  * E → C (Fossil Fuel Consumption drives Industrial Activities)



Graph Representation:
    
    
          (B) Deforestation
            ↓
     (A) Greenhouse Gas Emissions ⇔ (E) Fossil Fuel Consumption
            ↑               ↑
            |                |
     (C) Industrial Activities
            ↑
            |
     (D) Agriculture
            

Response: "Climate change is driven by several interrelated factors. The primary contributors include:

  1. Greenhouse Gas Emissions (Node A): These gases, such as carbon dioxide and methane, trap heat in the Earth's atmosphere, leading to global warming.
  2. Deforestation (Node B): The clearing of forests reduces the number of trees that can absorb carbon dioxide, thereby increasing the concentration of greenhouse gases in the atmosphere. Deforestation directly contributes to greenhouse gas emissions.
  3. Industrial Activities (Node C): Industries release significant amounts of greenhouse gases through the burning of fossil fuels for energy and manufacturing processes. Industrial activities are closely tied to greenhouse gas emissions.
  4. Agriculture (Node D): Agricultural practices, including livestock farming and rice paddies, release methane and nitrous oxide, potent greenhouse gases. Agriculture also contributes to deforestation for expanding farmland.
  5. Fossil Fuel Consumption (Node E): The burning of fossil fuels for energy in transportation, electricity, and heating is a major source of carbon dioxide. Fossil fuel consumption drives industrial activities and is a significant source of greenhouse gas emissions.



These factors are interconnected. For example, increased fossil fuel consumption leads to more industrial activities, which in turn produce more greenhouse gas emissions. Deforestation exacerbates the problem by reducing the Earth's capacity to absorb carbon dioxide, further increasing greenhouse gas concentrations."

By using the Graph of Thought technique, the model organizes the information in a structured manner, clearly showing the relationships between different factors contributing to climate change. This helps in understanding the complexity and interconnectivity of the factors involved.

This categorization can help understand the techniques based on their approaches and methodologies.

### Conclusion

In conclusion, prompting techniques are powerful tools that can enhance the capabilities of Large Language Models (LLMs) by providing structured inputs that guide their responses. Through various techniques such as Zero-shot and Few-shot prompting, Chain-of-Thought reasoning, and Retrieval Augmented Generation (RAG), LLMs can perform a wide range of tasks, from simple translations to complex decision-making processes.

The evolution of prompting techniques has been driven by the need to improve the model's understanding and performance on diverse tasks. Techniques like Chain-of-Thought (CoT), Self-Consistency, and Tree of Thoughts have enabled LLMs to reason through complex scenarios and generate more accurate and coherent responses. Similarly, advanced techniques such as Generate Knowledge and Retrieval Augmented Generation (RAG) have allowed LLMs to synthesize new information and incorporate external knowledge into their responses, further enhancing their capabilities.

Looking ahead, there is ample room for further exploration and experimentation with prompting techniques. As LLMs continue to evolve, researchers and practitioners can explore new ways to improve the model's understanding and reasoning abilities. By continuing to innovate and push the boundaries of what is possible, we can unlock new possibilities for LLMs and their applications in various fields.

`` `` `` `` ``

``

[ Like ](https://www.linkedin.com/signup/cold-join?session_redirect=%2Fpulse%2Fprompting-techniques-large-language-models-llms-pankaj-kumar-yadav-ivcpc&trk=article-ssr-frontend-pulse_x-social-details_like-toggle_like-cta)

Like

Celebrate

Support

Love

Insightful

Funny

[ Comment  ](https://www.linkedin.com/signup/cold-join?session_redirect=%2Fpulse%2Fprompting-techniques-large-language-models-llms-pankaj-kumar-yadav-ivcpc&trk=article-ssr-frontend-pulse_comment-cta)

`` ``

  * Copy
  * LinkedIn
  * Facebook
  * Twitter

Share 

`` ``

[ 15  ](https://www.linkedin.com/signup/cold-join?session_redirect=%2Fpulse%2Fprompting-techniques-large-language-models-llms-pankaj-kumar-yadav-ivcpc&trk=article-ssr-frontend-pulse_x-social-details_likes-count_social-actions-reactions) `` `` `` `` `` `` ``

To view or add a comment, [sign in](https://www.linkedin.com/signup/cold-join?session_redirect=%2Fpulse%2Fprompting-techniques-large-language-models-llms-pankaj-kumar-yadav-ivcpc&trk=article-ssr-frontend-pulse_x-social-details_feed-cta-banner-cta)

##  More articles by Pankaj kumar Yadav 

  * [ Plan for a Personal AI assistant  ](https://www.linkedin.com/pulse/plan-personal-ai-assistant-pankaj-kumar-yadav-lr9zc)

Oct 22, 2024

###  Plan for a Personal AI assistant 

High level plan for a personal assistant - almost all services have a free tier which works for personal use. Planning… 

`` ``

10 

`` `` `` `` `` `` ``

1 Comment 

  * [ Emergent properties and use cases for LLMs  ](https://www.linkedin.com/pulse/emergent-properties-use-cases-llms-pankaj-kumar-yadav-pffpc)

May 12, 2024

###  Emergent properties and use cases for LLMs 

Introduction: In recent years, the field of natural language processing (NLP) has witnessed a remarkable breakthrough… 

`` ``

9 

`` `` `` `` `` `` ``

3 Comments 

  * [ Understanding the LLM architecture in simple terms  ](https://www.linkedin.com/pulse/understanding-llm-architecture-simple-terms-pankaj-kumar-yadav-xlshc)

May 5, 2024

###  Understanding the LLM architecture in simple terms 

Introduction: In recent years, Large Language Models (LLMs) have taken the world by storm, revolutionizing the field of… 

`` ``

12 

`` `` `` `` `` `` ``

  * [ Understanding the Different Types of AI Models  ](https://www.linkedin.com/pulse/understanding-different-types-ai-models-pankaj-kumar-yadav-2tm9c)

Apr 30, 2024

###  Understanding the Different Types of AI Models 

Artificial Intelligence (AI) has revolutionized the way we approach problem-solving and decision-making. AI models… 

`` ``

20 

`` `` `` `` `` `` ``




## Sign in

Stay updated on your professional world

[ Sign in ](https://www.linkedin.com/uas/login?session_redirect=%2Fpulse%2Fprompting-techniques-large-language-models-llms-pankaj-kumar-yadav-ivcpc&trk=article-ssr-frontend-pulse_xandr-ad-fallback_signin)

By clicking Continue to join or sign in, you agree to LinkedIn’s [User Agreement](/legal/user-agreement?trk=article-ssr-frontend-pulse_auth-button_user-agreement), [Privacy Policy](/legal/privacy-policy?trk=article-ssr-frontend-pulse_auth-button_privacy-policy), and [Cookie Policy](/legal/cookie-policy?trk=article-ssr-frontend-pulse_auth-button_cookie-policy). 

New to LinkedIn? [Join now](https://www.linkedin.com/signup/cold-join?session_redirect=%2Fpulse%2Fprompting-techniques-large-language-models-llms-pankaj-kumar-yadav-ivcpc&trk=article-ssr-frontend-pulse_xandr-ad-fallback_join-link)

##  Insights from the community 

  * [ Linguistics  You’ve collected data on language change. How can you analyze it effectively?  ](https://www.linkedin.com/advice/0/youve-collected-data-language-change-how-can-you-analyze-yaccf)
  * [ Linguistics  What is the role of prosody in language acquisition?  ](https://www.linkedin.com/advice/0/what-role-prosody-language-acquisition-skills-linguistics)
  * [ Linguistics  You're studying language acquisition in the field. How can you make sure you're using the best tools?  ](https://www.linkedin.com/advice/0/youre-studying-language-acquisition-field-how-can-you-wpu8f)
  * [ Linguistics  What are the advantages of using social media to analyze linguistic data?  ](https://www.linkedin.com/advice/1/what-advantages-using-social-media-analyze-linguistic-4af1f)
  * [ Linguistics  What do you do if your linguistic analysis is limited by outdated software tools?  ](https://www.linkedin.com/advice/3/what-do-you-your-linguistic-analysis-limited-outdated-ct6me)
  * [ Linguistics  Analyzing massive language datasets under time constraints: Can you effectively navigate unexpected delays?  ](https://www.linkedin.com/advice/3/analyzing-massive-language-datasets-under-time-constraints-xkcgc)
  * [ Linguistics  Here's how you can enhance your logical reasoning skills in linguistics.  ](https://www.linkedin.com/advice/3/heres-how-you-can-enhance-your-logical-reasoning-skills-iaj5c)

Show more  Show less 

##  Others also viewed 

  * ### [ 5 Datapoints Defining Language Services in 2024  CSA Research  1y  ](https://www.linkedin.com/pulse/5-datapoints-defining-language-services-2024-csa-research-k1pdc)
  * ### [ Language Tech through Time: A Lookback at the Linguist’s Landscape  Mother Tongue  2y  ](https://www.linkedin.com/pulse/language-tech-through-time-lookback-linguists-landscape-)
  * ### [ What Harry Potter and Generative AI Have in Common  CSA Research  1y  ](https://www.linkedin.com/pulse/what-harry-potter-generative-ai-have-common-csa-research)
  * ### [ Why LangChain is Not Suitable for Production Use: A Comprehensive Analysis  Zaytrics  6mo  ](https://www.linkedin.com/pulse/why-langchain-suitable-production-use-comprehensive-analysis-efygf)
  * ### [ Limitations of Language Models in Other Languages  SimulTrans  10mo  ](https://www.linkedin.com/pulse/limitations-language-models-other-languages-simultrans-1y7re)
  * ### [ Language Testing: Part Two  Geoff Jordan  1y  ](https://www.linkedin.com/pulse/language-testing-part-two-geoff-jordan-adpmf)
  * ### [ Language and Human Language  Dr. Prakash Chandra Patel , PhD (Eng), MPhil (Eng),  4mo  ](https://www.linkedin.com/pulse/language-human-dr-prakash-chandra-patel-phd-eng-mphil-eng--7hsjc)
  * ### [ Understanding Cultural Nuances: Can AI Keep Up?  TransPalm  7mo  ](https://www.linkedin.com/pulse/understanding-cultural-nuances-can-ai-keep-up-transpalm-ag7jf)

Show more  Show less 

##  Explore topics 

  * [ Sales ](https://www.linkedin.com/pulse/topics/sales-s5/)
  * [ Marketing ](https://www.linkedin.com/pulse/topics/marketing-s2461/)
  * [ IT Services ](https://www.linkedin.com/pulse/topics/it-services-s57547/)
  * [ Business Administration ](https://www.linkedin.com/pulse/topics/business-administration-s50111/)
  * [ HR Management ](https://www.linkedin.com/pulse/topics/hr-management-s50359/)
  * [ Engineering ](https://www.linkedin.com/pulse/topics/engineering-s166/)
  * [ Soft Skills ](https://www.linkedin.com/pulse/topics/soft-skills-s2976/)
  * [ See All ](https://www.linkedin.com/pulse/topics/home/)



  * LinkedIn (C) 2025
  * [ About ](https://about.linkedin.com?trk=d_flagship2_pulse_read_footer-about)
  * [ Accessibility ](https://www.linkedin.com/accessibility?trk=d_flagship2_pulse_read_footer-accessibility)
  * [ User Agreement ](https://www.linkedin.com/legal/user-agreement?trk=d_flagship2_pulse_read_footer-user-agreement)
  * [ Privacy Policy ](https://www.linkedin.com/legal/privacy-policy?trk=d_flagship2_pulse_read_footer-privacy-policy)
  * [ Your California Privacy Choices ](https://www.linkedin.com/legal/california-privacy-disclosure?trk=d_flagship2_pulse_read_footer-california-privacy-rights-act)
  * [ Cookie Policy ](https://www.linkedin.com/legal/cookie-policy?trk=d_flagship2_pulse_read_footer-cookie-policy)
  * [ Copyright Policy ](https://www.linkedin.com/legal/copyright-policy?trk=d_flagship2_pulse_read_footer-copyright-policy)
  * [ Brand Policy ](https://brand.linkedin.com/policies?trk=d_flagship2_pulse_read_footer-brand-policy)
  * [ Guest Controls ](https://www.linkedin.com/psettings/guest-controls?trk=d_flagship2_pulse_read_footer-guest-controls)
  * [ Community Guidelines ](https://www.linkedin.com/legal/professional-community-policies?trk=d_flagship2_pulse_read_footer-community-guide)
  *     * العربية (Arabic) 
    * বাংলা (Bangla) 
    * Čeština (Czech) 
    * Dansk (Danish) 
    * Deutsch (German) 
    * Ελληνικά (Greek) 
    * **English (English)**
    * Español (Spanish) 
    * فارسی (Persian) 
    * Suomi (Finnish) 
    * Français (French) 
    * हिंदी (Hindi) 
    * Magyar (Hungarian) 
    * Bahasa Indonesia (Indonesian) 
    * Italiano (Italian) 
    * עברית (Hebrew) 
    * 日本語 (Japanese) 
    * 한국어 (Korean) 
    * मराठी (Marathi) 
    * Bahasa Malaysia (Malay) 
    * Nederlands (Dutch) 
    * Norsk (Norwegian) 
    * ਪੰਜਾਬੀ (Punjabi) 
    * Polski (Polish) 
    * Português (Portuguese) 
    * Română (Romanian) 
    * Русский (Russian) 
    * Svenska (Swedish) 
    * తెలుగు (Telugu) 
    * ภาษาไทย (Thai) 
    * Tagalog (Tagalog) 
    * Türkçe (Turkish) 
    * Українська (Ukrainian) 
    * Tiếng Việt (Vietnamese) 
    * 简体中文 (Chinese (Simplified)) 
    * 正體中文 (Chinese (Traditional)) 
Language 


title: java - Match Mixer.Info of USB sound card to physical USB port it's connected to - Stack Overflow
scrape_date: 2025-03-18T12:03:06.370592
content_type: markdown
hash: 78f80926b3ea561db7183c1f1daa6e595ad87eee4faeb43aab8db398218fe9bf
url:
https://stackoverflow.com/questions/79518192/match-mixer-info-of-usb-sound-card-to-physical-usb-port-its-connected-to

content:
Skip to main content

[ Stack Overflow ](https://stackoverflow.com)

  1. [About](https://stackoverflow.co/)
  2. Products 
  3. [OverflowAI](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav-bar&utm_content=overflowai)



  1. [ Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers ](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-for-teams)
  2. [ Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand ](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-advertising)
  3. [ OverflowAI GenAI features for Teams ](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-ai)
  4. [ OverflowAPI Train & fine-tune LLMs ](https://stackoverflow.co/api-solutions/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-api)
  5. [ Labs The future of collective knowledge sharing ](https://stackoverflow.co/labs/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=labs)
  6. [About the company](https://stackoverflow.co/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=about-the-company) [Visit the blog](https://stackoverflow.blog/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=blog)



Loading…

  1. ###  [current community](https://stackoverflow.com)

     * [ Stack Overflow  ](https://stackoverflow.com)

[help](https://stackoverflow.com/help) [chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)

     * [ Meta Stack Overflow  ](https://meta.stackoverflow.com)

###  your communities 

[Sign up](https://stackoverflow.com/users/signup?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518192%2fmatch-mixer-info-of-usb-sound-card-to-physical-usb-port-its-connected-to) or [log in](https://stackoverflow.com/users/login?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518192%2fmatch-mixer-info-of-usb-sound-card-to-physical-usb-port-its-connected-to) to customize your list. 

### [more stack exchange communities](https://stackexchange.com/sites)

[company blog](https://stackoverflow.blog)

  2.   3. [Log in](https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518192%2fmatch-mixer-info-of-usb-sound-card-to-physical-usb-port-its-connected-to)
  4. [Sign up](https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518192%2fmatch-mixer-info-of-usb-sound-card-to-physical-usb-port-its-connected-to)



  1.     1. [ Home ](/)
    2. [ Questions ](/questions)
    3. [ Tags ](/tags)
    4.     5. [ Users ](/users)
    6. [ Companies ](https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav)
    7. [ Labs ](javascript:void\(0\))
    8. [ Jobs ](/jobs?source=so-left-nav)
    9. [ Discussions ](/beta/discussions)
    10. [ Collectives ](javascript:void\(0\))

    11. Communities for your favorite technologies. [Explore all Collectives](/collectives-all)

  2. Teams

![](https://cdn.sstatic.net/Img/teams/teams-promo.svg?v=e507948b81bf)

Ask questions, find answers and collaborate at work with Stack Overflow for Teams. 

[Try Teams for free](https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams)

  3. [ Teams ](javascript:void\(0\))
  4. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact)




##### Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

[ Learn more about Collectives ](/collectives)

**Teams**

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

[ Learn more about Teams ](https://stackoverflow.co/teams/)

Get early access and see previews of new features.

[ Learn more about Labs](https://stackoverflow.co/labs/)

# [Match Mixer.Info of USB sound card to physical USB port it's connected to](/questions/79518192/match-mixer-info-of-usb-sound-card-to-physical-usb-port-its-connected-to)

[ Ask Question ](/questions/ask)

Asked today

Modified [today](?lastactivity "2025-03-18 17:01:38Z")

Viewed 3 times 

0 

[](/posts/79518192/timeline "Show activity on this post.")

I will potentially have several USB sound cards connected to a single Raspberry PI and I want to play be able to play sound on speciffic sound card identified by physical USB port it's connected to

I can find USB sound cards using shell script

> find /sys/devices/ -name id | grep sound | grep usb

Which results in something like that (currently only one is connected)

> /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5.2/1-1.5.2:1.0/soundCard1/id

In Java when I fetch `Mixer.Info` using `AudioSystem.getMixerInfo()` none of the properties of that sound card get me the info I need, for example:
    
    
    info.getName();    // "Device [plughw:1,0]"
    info.getDescription()    // Direct Audio Device: USB Audio Device, USB Audio, USB Audio
    info.toString()    // Device [plughw:1,0], version 5.10.103-v7+
    

Is there a way to match `Mixer.Info` to a speciffic device found in `/sys/devices/` ? Or any other way to identify device by USB port it's connected to?

  * [java](/questions/tagged/java "show questions tagged 'java'")
  * [linux](/questions/tagged/linux "show questions tagged 'linux'")
  * [java-audio](/questions/tagged/java-audio "show questions tagged 'java-audio'")



[Share](/q/79518192 "Short permalink to this question")

Follow 

asked 1 min ago

[![mag_zbc's user avatar](https://i.sstatic.net/lvi6j.jpg?s=64)](/users/1921348/mag-zbc)

[mag_zbc](/users/1921348/mag-zbc)mag_zbc

6,9931414 gold badges4343 silver badges6464 bronze badges




Add a comment  | 

Related questions

[ 3  Java Sound API - Distinguish multiple equal USB sound cards ](/questions/1881729/java-sound-api-distinguish-multiple-equal-usb-sound-cards)

[ 2  Java Sound API on OS X with USB Sound Card ](/questions/2104425/java-sound-api-on-os-x-with-usb-sound-card)

[ 5  Identify connected usb and built-in usb ](/questions/9188549/identify-connected-usb-and-built-in-usb)

Related questions

[ 3  Java Sound API - Distinguish multiple equal USB sound cards ](/questions/1881729/java-sound-api-distinguish-multiple-equal-usb-sound-cards)

[ 2  Java Sound API on OS X with USB Sound Card ](/questions/2104425/java-sound-api-on-os-x-with-usb-sound-card)

[ 5  Identify connected usb and built-in usb ](/questions/9188549/identify-connected-usb-and-built-in-usb)

[ 2  Associate physical usb port to device ](/questions/62779186/associate-physical-usb-port-to-device)

[ 1  pcsc-lite : multiple ACR122T devices with no unique serial number - linux ](/questions/28058477/pcsc-lite-multiple-acr122t-devices-with-no-unique-serial-number-linux)

[ 12  Android (Java) Real-time Audio Input (microphone AND USB) and Output ](/questions/13574942/android-java-real-time-audio-input-microphone-and-usb-and-output)

[ 6  Find which drive corresponds to which USB mass storage device in Linux ](/questions/3881449/find-which-drive-corresponds-to-which-usb-mass-storage-device-in-linux)

Load 4 more related questions  Show fewer related questions 

##  0

Sorted by:  [ Reset to default ](/questions/79518192/match-mixer-info-of-usb-sound-card-to-physical-usb-port-its-connected-to?answertab=scoredesc#tab-top)

Highest score (default)  Trending (recent votes count more)  Date modified (newest first)  Date created (oldest first) 

##  Know someone who can answer? Share a link to this [question](https://stackoverflow.com/questions/79518192/match-mixer-info-of-usb-sound-card-to-physical-usb-port-its-connected-to) via [email](/cdn-cgi/l/email-protection#b48bc7c1d6ded1d7c089e7c0d5d7df918684fbc2d1c6d2d8dbc3918684e5c1d1c7c0dddbda92d5d9c48fd6dbd0cd89f9d5c0d7dc918684f9ddccd1c69afddad2db918684dbd2918684e1e7f6918684c7dbc1dad0918684d7d5c6d0918684c0db918684c4dccdc7ddd7d5d8918684e1e7f6918684c4dbc6c0918684ddc0918683c7918684d7dbdadad1d7c0d1d0918684c0db9184f5dcc0c0c4c79187d59186d29186d2c7c0d5d7dfdbc2d1c6d2d8dbc39ad7dbd99186d2c59186d2838d81858c858d869187d2c7d1d99187d086), [Twitter](https://twitter.com/share?url=https%3a%2f%2fstackoverflow.com%2fq%2f79518192%3fstw%3d2), or [Facebook](https://www.facebook.com/sharer.php?u=https%3a%2f%2fstackoverflow.com%2fq%2f79518192%3fsfb%3d2). 

##  Your Answer 

Thanks for contributing an answer to Stack Overflow!

  * Please be sure to _answer the question_. Provide details and share your research!



But _avoid_ …

  * Asking for help, clarification, or responding to other answers.
  * Making statements based on opinion; back them up with references or personal experience.



To learn more, see our [tips on writing great answers](/help/how-to-answer).

Draft saved

Draft discarded

### Sign up or [log in](/users/login?ssrc=question_page&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518192%2fmatch-mixer-info-of-usb-sound-card-to-physical-usb-port-its-connected-to%23new-answer)

Sign up using Google 

Sign up using Email and Password 

Submit

### Post as a guest

Name

Email

Required, but never shown

### Post as a guest

Name

Email

Required, but never shown

Post Your Answer  Discard 

By clicking “Post Your Answer”, you agree to our [terms of service](https://stackoverflow.com/legal/terms-of-service/public) and acknowledge you have read our [privacy policy](https://stackoverflow.com/legal/privacy-policy).

Start asking to get answers

Find the answer to your question by asking.

[Ask question](/questions/ask)

Explore related questions

  * [java](/questions/tagged/java "show questions tagged 'java'")
  * [linux](/questions/tagged/linux "show questions tagged 'linux'")
  * [java-audio](/questions/tagged/java-audio "show questions tagged 'java-audio'")



See similar questions with these tags.

  * The Overflow Blog 
  * [To get ahead with AI, fine-tune your data strategy](https://stackoverflow.blog/2025/03/17/to-get-ahead-with-ai-fine-tune-your-data-strategy/)

  * [Improving error monitoring with AI](https://stackoverflow.blog/2025/03/18/improving-error-monitoring-with-ai/)

  * Featured on Meta 
  * [Community Asks Sprint Announcement - March 2025](https://meta.stackexchange.com/questions/407321/community-asks-sprint-announcement-march-2025)

  * [Experimenting with a new experiment opt-out option](https://meta.stackexchange.com/questions/407547/experimenting-with-a-new-experiment-opt-out-option)

  * [Stacks Editor development and testing](https://meta.stackoverflow.com/questions/433034/stacks-editor-development-and-testing)

  * [Policy: Generative AI (e.g., ChatGPT) is banned](https://meta.stackoverflow.com/questions/421831/policy-generative-ai-e-g-chatgpt-is-banned)

  * [Is it better to redirect users who attempt to perform actions they can't yet...](https://meta.stackoverflow.com/questions/432989/is-it-better-to-redirect-users-who-attempt-to-perform-actions-they-cant-yet-tak "Is it better to redirect users who attempt to perform actions they can't yet take?")




####  [ Hot Network Questions ](https://stackexchange.com/questions?tab=hot)

  * [ What size breaker do I need for a 31.25 Amp heater? ](https://diy.stackexchange.com/questions/315950/what-size-breaker-do-i-need-for-a-31-25-amp-heater)
  * [ Is it common now that Thailand immigration asks for proof of onward travel? ](https://travel.stackexchange.com/questions/193788/is-it-common-now-that-thailand-immigration-asks-for-proof-of-onward-travel)
  * [ What is the purpose of DPMI interrupt 31h function 300h? ](https://retrocomputing.stackexchange.com/questions/31426/what-is-the-purpose-of-dpmi-interrupt-31h-function-300h)
  * [ Can we still use the word "tweet" now that Twitter has been rebranded as X? ](https://ell.stackexchange.com/questions/363209/can-we-still-use-the-word-tweet-now-that-twitter-has-been-rebranded-as-x)
  * [ N Dice problem with Sum and Disivibility ](https://mathematica.stackexchange.com/questions/311609/n-dice-problem-with-sum-and-disivibility)
  * [ Debugging a performance issue, do I commit the timing code? ](https://softwareengineering.stackexchange.com/questions/456868/debugging-a-performance-issue-do-i-commit-the-timing-code)
  * [ What does "Fine for the Beaver, but not exactly tycoon territory" mean? ](https://movies.stackexchange.com/questions/124872/what-does-fine-for-the-beaver-but-not-exactly-tycoon-territory-mean)
  * [ Tips for golfing in ☾ (Moon) ](https://codegolf.stackexchange.com/questions/278720/tips-for-golfing-in-moon)
  * [ Can one detect that the derived pushforward of a coherent sheaf is zero? ](https://mathoverflow.net/questions/489607/can-one-detect-that-the-derived-pushforward-of-a-coherent-sheaf-is-zero)
  * [ How to make the weather matter? ](https://rpg.stackexchange.com/questions/214997/how-to-make-the-weather-matter)
  * [ Clustered Index Update operator performing excessive Logical Reads after query change ](https://dba.stackexchange.com/questions/345758/clustered-index-update-operator-performing-excessive-logical-reads-after-query-c)
  * [ Unexpected Mixpanel Cookie: Is this an attempted exploit? ](https://security.stackexchange.com/questions/280846/unexpected-mixpanel-cookie-is-this-an-attempted-exploit)
  * [ Why does Starship launch on a cloud? ](https://space.stackexchange.com/questions/68082/why-does-starship-launch-on-a-cloud)
  * [ What does tying up the strongman mean in Matthew 12? ](https://hermeneutics.stackexchange.com/questions/102376/what-does-tying-up-the-strongman-mean-in-matthew-12)
  * [ Can I switch from Sales to Data Science/Analysis with no degree in a year? ](https://datascience.stackexchange.com/questions/131582/can-i-switch-from-sales-to-data-science-analysis-with-no-degree-in-a-year)
  * [ Do pentesters need to be able to fix their findings for their customers? ](https://security.stackexchange.com/questions/280837/do-pentesters-need-to-be-able-to-fix-their-findings-for-their-customers)
  * [ Minimizing the Sum of Elementwise Products for Three Permutations of a Sequence ](https://math.stackexchange.com/questions/5046871/minimizing-the-sum-of-elementwise-products-for-three-permutations-of-a-sequence)
  * [ Validity of presidential orders "signed" with an "autopen" machine ](https://law.stackexchange.com/questions/107828/validity-of-presidential-orders-signed-with-an-autopen-machine)
  * [ PMOS Gate Drive in Typical Application Circuit ](https://electronics.stackexchange.com/questions/741796/pmos-gate-drive-in-typical-application-circuit)
  * [ Trace distance under quantum gates and measurements ](https://quantumcomputing.stackexchange.com/questions/41464/trace-distance-under-quantum-gates-and-measurements)
  * [ What is a 'Phlegm dealership'? ](https://movies.stackexchange.com/questions/124871/what-is-a-phlegm-dealership)
  * [ Simplest problems showing that "Spec Z is where schemes really shine" ](https://math.stackexchange.com/questions/5046936/simplest-problems-showing-that-spec-z-is-where-schemes-really-shine)
  * [ How would humans need to adapt in order to survive in overgrown world? ](https://worldbuilding.stackexchange.com/questions/265367/how-would-humans-need-to-adapt-in-order-to-survive-in-overgrown-world)
  * [ What happens if Flixbus doesn't assign a seat on the ticket? ](https://travel.stackexchange.com/questions/193776/what-happens-if-flixbus-doesnt-assign-a-seat-on-the-ticket)

more hot questions 

[ Question feed ](/feeds/question/79518192 "Feed of this question and its answers")

#  Subscribe to RSS 

Question feed 

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

![](/posts/79518192/ivc/76f2?prg=841df479-32a4-47d7-8bc9-f37c7ba83a07)

lang-java

[](https://stackoverflow.com)

##### [Stack Overflow](https://stackoverflow.com)

  * [Questions](/questions)
  * [Help](/help)
  * [Chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)



##### [Products](https://stackoverflow.co/)

  * [Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=teams)
  * [Advertising](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=advertising)
  * [Talent](https://stackoverflow.co/advertising/employer-branding/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=talent)



##### [Company](https://stackoverflow.co/)

  * [About](https://stackoverflow.co/)
  * [Press](https://stackoverflow.co/company/press/)
  * [Work Here](https://stackoverflow.co/company/work-here/)
  * [Legal](https://stackoverflow.com/legal)
  * [Privacy Policy](https://stackoverflow.com/legal/privacy-policy)
  * [Terms of Service](https://stackoverflow.com/legal/terms-of-service/public)
  * [Contact Us](/contact)
  * Your Privacy Choices 
  * [Cookie Policy](https://stackoverflow.com/legal/cookie-policy)



##### [Stack Exchange Network](https://stackexchange.com)

  * [ Technology ](https://stackexchange.com/sites#technology)
  * [ Culture & recreation ](https://stackexchange.com/sites#culturerecreation)
  * [ Life & arts ](https://stackexchange.com/sites#lifearts)
  * [ Science ](https://stackexchange.com/sites#science)
  * [ Professional ](https://stackexchange.com/sites#professional)
  * [ Business ](https://stackexchange.com/sites#business)
  * [ API ](https://api.stackexchange.com/)
  * [ Data ](https://data.stackexchange.com/)



  * [Blog](https://stackoverflow.blog?blb=1)
  * [Facebook](https://www.facebook.com/officialstackoverflow/)
  * [Twitter](https://twitter.com/stackoverflow)
  * [LinkedIn](https://linkedin.com/company/stack-overflow)
  * [Instagram](https://www.instagram.com/thestackoverflow)



Site design / logo © 2025 Stack Exchange Inc;  user contributions licensed under  [CC BY-SA](https://stackoverflow.com/help/licensing) .  rev 2025.3.17.23948


title: Having issue installing Cassandra 4.1.8 on Amazon Linux 3 - Stack Overflow
scrape_date: 2025-03-18T12:03:06.375463
content_type: markdown
hash: 03fa8bb9c58678d964d5b2549e0d46e3f0c577af95bfb968c77a936a82792a75
url:
https://stackoverflow.com/questions/79518191/having-issue-installing-cassandra-4-1-8-on-amazon-linux-3

content:
Skip to main content

[ Stack Overflow ](https://stackoverflow.com)

  1. [About](https://stackoverflow.co/)
  2. Products 
  3. [OverflowAI](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav-bar&utm_content=overflowai)



  1. [ Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers ](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-for-teams)
  2. [ Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand ](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-advertising)
  3. [ OverflowAI GenAI features for Teams ](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-ai)
  4. [ OverflowAPI Train & fine-tune LLMs ](https://stackoverflow.co/api-solutions/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-api)
  5. [ Labs The future of collective knowledge sharing ](https://stackoverflow.co/labs/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=labs)
  6. [About the company](https://stackoverflow.co/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=about-the-company) [Visit the blog](https://stackoverflow.blog/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=blog)



Loading…

  1. ###  [current community](https://stackoverflow.com)

     * [ Stack Overflow  ](https://stackoverflow.com)

[help](https://stackoverflow.com/help) [chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)

     * [ Meta Stack Overflow  ](https://meta.stackoverflow.com)

###  your communities 

[Sign up](https://stackoverflow.com/users/signup?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518191%2fhaving-issue-installing-cassandra-4-1-8-on-amazon-linux-3) or [log in](https://stackoverflow.com/users/login?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518191%2fhaving-issue-installing-cassandra-4-1-8-on-amazon-linux-3) to customize your list. 

### [more stack exchange communities](https://stackexchange.com/sites)

[company blog](https://stackoverflow.blog)

  2.   3. [Log in](https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518191%2fhaving-issue-installing-cassandra-4-1-8-on-amazon-linux-3)
  4. [Sign up](https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518191%2fhaving-issue-installing-cassandra-4-1-8-on-amazon-linux-3)



  1.     1. [ Home ](/)
    2. [ Questions ](/questions)
    3. [ Tags ](/tags)
    4.     5. [ Users ](/users)
    6. [ Companies ](https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav)
    7. [ Labs ](javascript:void\(0\))
    8. [ Jobs ](/jobs?source=so-left-nav)
    9. [ Discussions ](/beta/discussions)
    10. [ Collectives ](javascript:void\(0\))

    11. Communities for your favorite technologies. [Explore all Collectives](/collectives-all)

  2. Teams

![](https://cdn.sstatic.net/Img/teams/teams-promo.svg?v=e507948b81bf)

Ask questions, find answers and collaborate at work with Stack Overflow for Teams. 

[Try Teams for free](https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams)

  3. [ Teams ](javascript:void\(0\))
  4. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact)




##### Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

[ Learn more about Collectives ](/collectives)

**Teams**

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

[ Learn more about Teams ](https://stackoverflow.co/teams/)

Get early access and see previews of new features.

[ Learn more about Labs](https://stackoverflow.co/labs/)

# [Having issue installing Cassandra 4.1.8 on Amazon Linux 3](/questions/79518191/having-issue-installing-cassandra-4-1-8-on-amazon-linux-3)

[ Ask Question ](/questions/ask)

Asked today

Modified [today](?lastactivity "2025-03-18 17:01:13Z")

Viewed 3 times 

0 

[](/posts/79518191/timeline "Show activity on this post.")

I'm trying to install Cassandra 4.1.8 on Amazon Linux 3, and it fails due to the below error.

I did install amazon version of java 1.8 - but that doesn't come with the headless package.

Has anyone run into the same issue before? - any suggestions on how can I make this work?
    
    
    yum install cassandra
    Apache Cassandra                                                                                                                                                                                                             9.5 kB/s | 3.0 kB     00:00
    Error:
     Problem: conflicting requests
      - nothing provides java-1.8.0-headless needed by cassandra-4.1.8-1.noarch from cassandra
    (try to add '--skip-broken' to skip uninstallable packages)
    
    yum --showduplicates search java-1.8
    Last metadata expiration check: 0:00:15 ago on Tue Mar 18 16:47:55 2025.
    ================================================================================================================== Name Matched: java-1.8 ===================================================================================================================
    java-1.8.0-amazon-corretto-1:1.8.0_362.b08-1.amzn2023.x86_64 : Amazon Corretto runtime environment
    java-1.8.0-amazon-corretto-1:1.8.0_372.b07-1.amzn2023.x86_64 : Amazon Corretto runtime environment
    java-1.8.0-amazon-corretto-1:1.8.0_382.b05-1.amzn2023.x86_64 : Amazon Corretto runtime environment
    java-1.8.0-amazon-corretto-1:1.8.0_392.b08-1.amzn2023.x86_64 : Amazon Corretto runtime environment
    java-1.8.0-amazon-corretto-1:1.8.0_402.b06-1.amzn2023.x86_64 : Amazon Corretto runtime environment
    java-1.8.0-amazon-corretto-1:1.8.0_402.b08-1.amzn2023.x86_64 : Amazon Corretto runtime environment
    java-1.8.0-amazon-corretto-1:1.8.0_412.b08-1.amzn2023.x86_64 : Amazon Corretto runtime environment
    java-1.8.0-amazon-corretto-devel-1:1.8.0_362.b08-1.amzn2023.x86_64 : Amazon Corretto development environment
    java-1.8.0-amazon-corretto-devel-1:1.8.0_372.b07-1.amzn2023.x86_64 : Amazon Corretto development environment
    java-1.8.0-amazon-corretto-devel-1:1.8.0_382.b05-1.amzn2023.x86_64 : Amazon Corretto development environment
    java-1.8.0-amazon-corretto-devel-1:1.8.0_392.b08-1.amzn2023.x86_64 : Amazon Corretto development environment
    java-1.8.0-amazon-corretto-devel-1:1.8.0_402.b06-1.amzn2023.x86_64 : Amazon Corretto development environment
    java-1.8.0-amazon-corretto-devel-1:1.8.0_402.b08-1.amzn2023.x86_64 : Amazon Corretto development environment
    java-1.8.0-amazon-corretto-devel-1:1.8.0_412.b08-1.amzn2023.x86_64 : Amazon Corretto development environment
    
    java -version
    openjdk version "1.8.0_412"
    OpenJDK Runtime Environment Corretto-8.412.08.1 (build 1.8.0_412-b08)
    OpenJDK 64-Bit Server VM Corretto-8.412.08.1 (build 25.412-b08, mixed mode)
    
    rpm -qa |grep -i java
    javapackages-filesystem-6.0.0-7.amzn2023.0.6.noarch
    java-1.8.0-amazon-corretto-1.8.0_412.b08-1.amzn2023.x86_64
    

  * [cassandra](/questions/tagged/cassandra "show questions tagged 'cassandra'")
  * [amazon-linux-2023](/questions/tagged/amazon-linux-2023 "show questions tagged 'amazon-linux-2023'")



[Share](/q/79518191 "Short permalink to this question")

Follow 

asked 1 min ago

[![dmode's user avatar](https://www.gravatar.com/avatar/a2e98e826af8bb987957a1703aa39704?s=64&d=identicon&r=PG&f=y&so-version=2)](/users/6019539/dmode)

[dmode](/users/6019539/dmode)dmode

1




Add a comment  | 

Related questions

[ 1  Apache Cassandra fails to start - SIGSEGV error when using non-default tmp directory ](/questions/78662153/apache-cassandra-fails-to-start-sigsegv-error-when-using-non-default-tmp-direc)

[ 2  Scylla Installation issue on RHEL and CentOS ](/questions/54685816/scylla-installation-issue-on-rhel-and-centos)

[ 6  Cassandra Amazon EC2, Read Performance experiments ](/questions/11881658/cassandra-amazon-ec2-read-performance-experiments)

Related questions

[ 1  Apache Cassandra fails to start - SIGSEGV error when using non-default tmp directory ](/questions/78662153/apache-cassandra-fails-to-start-sigsegv-error-when-using-non-default-tmp-direc)

[ 2  Scylla Installation issue on RHEL and CentOS ](/questions/54685816/scylla-installation-issue-on-rhel-and-centos)

[ 6  Cassandra Amazon EC2, Read Performance experiments ](/questions/11881658/cassandra-amazon-ec2-read-performance-experiments)

[ 1  Upgrade from 3.11.x Cassandra to 4.1.8 in Amazon Linux 2 gpg key issue ](/questions/79493671/upgrade-from-3-11-x-cassandra-to-4-1-8-in-amazon-linux-2-gpg-key-issue)

[ 3  Installing cassandra in ubuntu? ](/questions/3207226/installing-cassandra-in-ubuntu)

[ 8  Cassandra Authentication issue ](/questions/31635963/cassandra-authentication-issue)

[ 14  Cassandra Vs Amazon SimpleDB ](/questions/1839218/cassandra-vs-amazon-simpledb)

[ 0  How to resolve issue in installing Apache Cassandra? ](/questions/75761174/how-to-resolve-issue-in-installing-apache-cassandra)

[ 0  Having UDT in Cassandra can cause performance issue? ](/questions/50162397/having-udt-in-cassandra-can-cause-performance-issue)

Load 6 more related questions  Show fewer related questions 

##  0

Sorted by:  [ Reset to default ](/questions/79518191/having-issue-installing-cassandra-4-1-8-on-amazon-linux-3?answertab=scoredesc#tab-top)

Highest score (default)  Trending (recent votes count more)  Date modified (newest first)  Date created (oldest first) 

##  Know someone who can answer? Share a link to this [question](https://stackoverflow.com/questions/79518191/having-issue-installing-cassandra-4-1-8-on-amazon-linux-3) via [email](/cdn-cgi/l/email-protection#754a0600171f10160148260114161e5047453a03100713191a0250474524001006011c1a1b531418054e171a110c483d14031c1b125047451c060600105047451c1b06011419191c1b1250474536140606141b110714504745415b445b4d5047451a1b5047453418140f1a1b504745391c1b000d504745465045341d01010506504614504713504713060114161e1a03100713191a025b161a1850471304504713424c40444d444c4450461306101850461147), [Twitter](https://twitter.com/share?url=https%3a%2f%2fstackoverflow.com%2fq%2f79518191%3fstw%3d2), or [Facebook](https://www.facebook.com/sharer.php?u=https%3a%2f%2fstackoverflow.com%2fq%2f79518191%3fsfb%3d2). 

##  Your Answer 

Thanks for contributing an answer to Stack Overflow!

  * Please be sure to _answer the question_. Provide details and share your research!



But _avoid_ …

  * Asking for help, clarification, or responding to other answers.
  * Making statements based on opinion; back them up with references or personal experience.



To learn more, see our [tips on writing great answers](/help/how-to-answer).

Draft saved

Draft discarded

### Sign up or [log in](/users/login?ssrc=question_page&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518191%2fhaving-issue-installing-cassandra-4-1-8-on-amazon-linux-3%23new-answer)

Sign up using Google 

Sign up using Email and Password 

Submit

### Post as a guest

Name

Email

Required, but never shown

### Post as a guest

Name

Email

Required, but never shown

Post Your Answer  Discard 

By clicking “Post Your Answer”, you agree to our [terms of service](https://stackoverflow.com/legal/terms-of-service/public) and acknowledge you have read our [privacy policy](https://stackoverflow.com/legal/privacy-policy).

Start asking to get answers

Find the answer to your question by asking.

[Ask question](/questions/ask)

Explore related questions

  * [cassandra](/questions/tagged/cassandra "show questions tagged 'cassandra'")
  * [amazon-linux-2023](/questions/tagged/amazon-linux-2023 "show questions tagged 'amazon-linux-2023'")



See similar questions with these tags.

  * The Overflow Blog 
  * [To get ahead with AI, fine-tune your data strategy](https://stackoverflow.blog/2025/03/17/to-get-ahead-with-ai-fine-tune-your-data-strategy/)

  * [Improving error monitoring with AI](https://stackoverflow.blog/2025/03/18/improving-error-monitoring-with-ai/)

  * Featured on Meta 
  * [Community Asks Sprint Announcement - March 2025](https://meta.stackexchange.com/questions/407321/community-asks-sprint-announcement-march-2025)

  * [Experimenting with a new experiment opt-out option](https://meta.stackexchange.com/questions/407547/experimenting-with-a-new-experiment-opt-out-option)

  * [Stacks Editor development and testing](https://meta.stackoverflow.com/questions/433034/stacks-editor-development-and-testing)

  * [Policy: Generative AI (e.g., ChatGPT) is banned](https://meta.stackoverflow.com/questions/421831/policy-generative-ai-e-g-chatgpt-is-banned)

  * [Is it better to redirect users who attempt to perform actions they can't yet...](https://meta.stackoverflow.com/questions/432989/is-it-better-to-redirect-users-who-attempt-to-perform-actions-they-cant-yet-tak "Is it better to redirect users who attempt to perform actions they can't yet take?")




####  [ Hot Network Questions ](https://stackexchange.com/questions?tab=hot)

  * [ What is the idea behind 20. b4 in this position? ](https://chess.stackexchange.com/questions/46785/what-is-the-idea-behind-20-b4-in-this-position)
  * [ PMOS Gate Drive in Typical Application Circuit ](https://electronics.stackexchange.com/questions/741796/pmos-gate-drive-in-typical-application-circuit)
  * [ Can I bring a guest to stay in a house I co-own without the consent of the other owner? ](https://law.stackexchange.com/questions/107819/can-i-bring-a-guest-to-stay-in-a-house-i-co-own-without-the-consent-of-the-other)
  * [ What happens if I choose to pay Vik back or not? ](https://gaming.stackexchange.com/questions/411558/what-happens-if-i-choose-to-pay-vik-back-or-not)
  * [ Why does the "花" for "flower" and "spending money" uses the same character? ](https://chinese.stackexchange.com/questions/59928/why-does-the-%e8%8a%b1-for-flower-and-spending-money-uses-the-same-character)
  * [ Entering USA as an Iranian Born naturalized British Citizen ](https://travel.stackexchange.com/questions/193780/entering-usa-as-an-iranian-born-naturalized-british-citizen)
  * [ Why are Chess.com calling for the Bishop to be renamed? ](https://chess.stackexchange.com/questions/46779/why-are-chess-com-calling-for-the-bishop-to-be-renamed)
  * [ Closed-source licensing of OS with Linux kernel ](https://opensource.stackexchange.com/questions/15414/closed-source-licensing-of-os-with-linux-kernel)
  * [ What is the purpose of DPMI interrupt 31h function 300h? ](https://retrocomputing.stackexchange.com/questions/31426/what-is-the-purpose-of-dpmi-interrupt-31h-function-300h)
  * [ Best weapon for humans to ambush sapient elephants? ](https://worldbuilding.stackexchange.com/questions/265378/best-weapon-for-humans-to-ambush-sapient-elephants)
  * [ Why did the CF-100 Canuck use straight wings instead of swept wings? ](https://aviation.stackexchange.com/questions/108206/why-did-the-cf-100-canuck-use-straight-wings-instead-of-swept-wings)
  * [ Unexpected Mixpanel Cookie: Is this an attempted exploit? ](https://security.stackexchange.com/questions/280846/unexpected-mixpanel-cookie-is-this-an-attempted-exploit)
  * [ Can I use the same wooden cutting board for vegetables and meat if I cut the vegetables first? ](https://cooking.stackexchange.com/questions/130354/can-i-use-the-same-wooden-cutting-board-for-vegetables-and-meat-if-i-cut-the-veg)
  * [ Is there anything like RMS for capacitor or inductor? ](https://electronics.stackexchange.com/questions/741754/is-there-anything-like-rms-for-capacitor-or-inductor)
  * [ Starting with a pile of 1,001 rocks, discarding some and splitting up the piles, can you eventually have all piles with exactly 3 rocks? ](https://puzzling.stackexchange.com/questions/130977/starting-with-a-pile-of-1-001-rocks-discarding-some-and-splitting-up-the-piles)
  * [ Transitions between states that are in a superposition of orbitals ](https://physics.stackexchange.com/questions/845557/transitions-between-states-that-are-in-a-superposition-of-orbitals)
  * [ Hidden Redstone Piston Door ](https://gaming.stackexchange.com/questions/411561/hidden-redstone-piston-door)
  * [ Is it customary for financial offers to be in writing? ](https://academia.stackexchange.com/questions/217404/is-it-customary-for-financial-offers-to-be-in-writing)
  * [ Losing StreamStyle in StreamPlot in 14.2 ](https://mathematica.stackexchange.com/questions/311635/losing-streamstyle-in-streamplot-in-14-2)
  * [ Unless in conditional sentences ](https://ell.stackexchange.com/questions/363259/unless-in-conditional-sentences)
  * [ What is a 'Phlegm dealership'? ](https://movies.stackexchange.com/questions/124871/what-is-a-phlegm-dealership)
  * [ What happens if Flixbus doesn't assign a seat on the ticket? ](https://travel.stackexchange.com/questions/193776/what-happens-if-flixbus-doesnt-assign-a-seat-on-the-ticket)
  * [ Where is the following verse found? ](https://hinduism.stackexchange.com/questions/62553/where-is-the-following-verse-found)
  * [ Do I ground IC pins marked "NC" in its datasheet? ](https://electronics.stackexchange.com/questions/741595/do-i-ground-ic-pins-marked-nc-in-its-datasheet)

more hot questions 

[ Question feed ](/feeds/question/79518191 "Feed of this question and its answers")

#  Subscribe to RSS 

Question feed 

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

![](/posts/79518191/ivc/76f2?prg=8343d7f1-480f-42dc-9567-9f7a52610970)

[](https://stackoverflow.com)

##### [Stack Overflow](https://stackoverflow.com)

  * [Questions](/questions)
  * [Help](/help)
  * [Chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)



##### [Products](https://stackoverflow.co/)

  * [Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=teams)
  * [Advertising](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=advertising)
  * [Talent](https://stackoverflow.co/advertising/employer-branding/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=talent)



##### [Company](https://stackoverflow.co/)

  * [About](https://stackoverflow.co/)
  * [Press](https://stackoverflow.co/company/press/)
  * [Work Here](https://stackoverflow.co/company/work-here/)
  * [Legal](https://stackoverflow.com/legal)
  * [Privacy Policy](https://stackoverflow.com/legal/privacy-policy)
  * [Terms of Service](https://stackoverflow.com/legal/terms-of-service/public)
  * [Contact Us](/contact)
  * Your Privacy Choices 
  * [Cookie Policy](https://stackoverflow.com/legal/cookie-policy)



##### [Stack Exchange Network](https://stackexchange.com)

  * [ Technology ](https://stackexchange.com/sites#technology)
  * [ Culture & recreation ](https://stackexchange.com/sites#culturerecreation)
  * [ Life & arts ](https://stackexchange.com/sites#lifearts)
  * [ Science ](https://stackexchange.com/sites#science)
  * [ Professional ](https://stackexchange.com/sites#professional)
  * [ Business ](https://stackexchange.com/sites#business)
  * [ API ](https://api.stackexchange.com/)
  * [ Data ](https://data.stackexchange.com/)



  * [Blog](https://stackoverflow.blog?blb=1)
  * [Facebook](https://www.facebook.com/officialstackoverflow/)
  * [Twitter](https://twitter.com/stackoverflow)
  * [LinkedIn](https://linkedin.com/company/stack-overflow)
  * [Instagram](https://www.instagram.com/thestackoverflow)



Site design / logo © 2025 Stack Exchange Inc;  user contributions licensed under  [CC BY-SA](https://stackoverflow.com/help/licensing) .  rev 2025.3.17.23948


title: testing - Automatically re-run failed only scenario in cucumber java+testng - Stack Overflow
scrape_date: 2025-03-18T12:03:06.375456
content_type: markdown
hash: bae10ddfd787df5da7f4c843f26167f3a665c3918e7b18e91c5554a40d060e99
url:
https://stackoverflow.com/questions/48660585/automatically-re-run-failed-only-scenario-in-cucumber-javatestng

content:
Skip to main content

[ Stack Overflow ](https://stackoverflow.com)

  1. [About](https://stackoverflow.co/)
  2. Products 
  3. [OverflowAI](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav-bar&utm_content=overflowai)



  1. [ Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers ](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-for-teams)
  2. [ Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand ](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-advertising)
  3. [ OverflowAI GenAI features for Teams ](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-ai)
  4. [ OverflowAPI Train & fine-tune LLMs ](https://stackoverflow.co/api-solutions/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-api)
  5. [ Labs The future of collective knowledge sharing ](https://stackoverflow.co/labs/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=labs)
  6. [About the company](https://stackoverflow.co/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=about-the-company) [Visit the blog](https://stackoverflow.blog/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=blog)



Loading…

  1. ###  [current community](https://stackoverflow.com)

     * [ Stack Overflow  ](https://stackoverflow.com)

[help](https://stackoverflow.com/help) [chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)

     * [ Meta Stack Overflow  ](https://meta.stackoverflow.com)

###  your communities 

[Sign up](https://stackoverflow.com/users/signup?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f48660585%2fautomatically-re-run-failed-only-scenario-in-cucumber-javatestng) or [log in](https://stackoverflow.com/users/login?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f48660585%2fautomatically-re-run-failed-only-scenario-in-cucumber-javatestng) to customize your list. 

### [more stack exchange communities](https://stackexchange.com/sites)

[company blog](https://stackoverflow.blog)

  2.   3. [Log in](https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f48660585%2fautomatically-re-run-failed-only-scenario-in-cucumber-javatestng)
  4. [Sign up](https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f48660585%2fautomatically-re-run-failed-only-scenario-in-cucumber-javatestng)



  1.     1. [ Home ](/)
    2. [ Questions ](/questions)
    3. [ Tags ](/tags)
    4.     5. [ Users ](/users)
    6. [ Companies ](https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav)
    7. [ Labs ](javascript:void\(0\))
    8. [ Jobs ](/jobs?source=so-left-nav)
    9. [ Discussions ](/beta/discussions)
    10. [ Collectives ](javascript:void\(0\))

    11. Communities for your favorite technologies. [Explore all Collectives](/collectives-all)

  2. Teams

![](https://cdn.sstatic.net/Img/teams/teams-promo.svg?v=e507948b81bf)

Ask questions, find answers and collaborate at work with Stack Overflow for Teams. 

[Try Teams for free](https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams)

  3. [ Teams ](javascript:void\(0\))
  4. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact)




##### Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

[ Learn more about Collectives ](/collectives)

**Teams**

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

[ Learn more about Teams ](https://stackoverflow.co/teams/)

Get early access and see previews of new features.

[ Learn more about Labs](https://stackoverflow.co/labs/)

# [Automatically re-run failed only scenario in cucumber java+testng](/questions/48660585/automatically-re-run-failed-only-scenario-in-cucumber-javatestng)

[ Ask Question ](/questions/ask)

Asked 7 years, 1 month ago

Modified [today](?lastactivity "2025-03-18 17:00:40Z")

Viewed 10k times 

0 

[](/posts/48660585/timeline "Show activity on this post.")

_How can I make only failed scenarios to be run again automatically on failure ?_

Here is some clue on what I am doing:

  * Pass TestRunner class from command line through cucumber-testng.xml file at run-time.
  * I am able to see rerun.txt file after scenario failed, with `feature/GM/TK/payment.feature:71` (pointing to failed scenario) but failed scenario is not automatically re-run.



The "TestRunner" java file
    
    
    @RunWith(Cucumber.class)
    @CucumberOptions(strict = true, 
        features = { "src/test/resources/" },  //feature file location
        glue = { "com/test/stepdefs", "com.test.cucumber.hooks" },  //hooks and stepdef location
        plugin = { "json:target/cucumber-report-composite.json", "pretty", "rerun:target/rerun.txt"}
    )
    public class CucumberTestRunner extends AbstractTestNGCucumberTests
    {
    }
    

The "RunFailedTest" Class to re-run from rerun.txt file
    
    
    @RunWith(Cucumber.class)
    @CucumberOptions(
        strict = false,
        features = { "@target/rerun.txt"  },  //rerun location
        glue = { "com/test/stepdefs", "com.test.cucumber.hooks" }, //hooks and stepdef location
        plugin = {"pretty", "html:target/site/cucumber-pretty", "json:target/cucumber.json"}
    )
    class RunFailedTest
    {
    }
    

  * [testing](/questions/tagged/testing "show questions tagged 'testing'")
  * [cucumber-java](/questions/tagged/cucumber-java "show questions tagged 'cucumber-java'")



[Share](/q/48660585 "Short permalink to this question")

[Improve this question](/posts/48660585/edit)

Follow 

[edited Feb 7, 2018 at 15:50](/posts/48660585/revisions "show all edits to this post")

[![Stphane's user avatar](https://www.gravatar.com/avatar/88fc6fa442af1461c0a09e37bc38522b?s=64&d=identicon&r=PG)](/users/1463336/stphane)

[Stphane](/users/1463336/stphane)

3,47655 gold badges3434 silver badges4848 bronze badges

asked Feb 7, 2018 at 9:47

[![kapil daksh's user avatar](https://lh6.googleusercontent.com/-cs47m3NHVic/AAAAAAAAAAI/AAAAAAAAAFQ/JnUJHsaeg_U/photo.jpg?sz=64)](/users/4030902/kapil-daksh)

[kapil daksh](/users/4030902/kapil-daksh)kapil daksh

111 silver badge22 bronze badges

4

  * Are you looking to dynamically identify the failed tests to rerun, or are you just manually separating them out into another file? It looks like the latter, in which case you should consider using [tags](https://github.com/cucumber/cucumber/wiki/Tags) and specifying them in your CucumberOptions.

- [jsheeran](/users/4742570/jsheeran "3,037 reputation")

Commented Feb 7, 2018 at 9:58

  * Possible duplicate of [How to rerun the failed scenarios using Cucumber?](https://stackoverflow.com/questions/11719898/how-to-rerun-the-failed-scenarios-using-cucumber)

- [Marit](/users/7121619/marit "3,066 reputation")

Commented Feb 8, 2018 at 12:04

  * jsheeran yeah dynamically failed scenario gets stored in rerun.txt and automatically run instantly as fail accoutered once first execution done

- [kapil daksh](/users/4030902/kapil-daksh "1 reputation")

Commented Feb 10, 2018 at 4:44

  * Why do you have both junit and testng in CucumberTestRunner? And only junit in the RunFailedTest? How are you running the test?

- [Grasshopper](/users/4512398/grasshopper "9,058 reputation")

Commented Feb 19, 2018 at 13:42




Add a comment  | 

##  2 Answers 2

Sorted by:  [ Reset to default ](/questions/48660585/automatically-re-run-failed-only-scenario-in-cucumber-javatestng?answertab=scoredesc#tab-top)

Highest score (default)  Trending (recent votes count more)  Date modified (newest first)  Date created (oldest first) 

0 

[](/posts/50553669/timeline "Show activity on this post.")

you can achieve it by using [gherkin with qaf](https://qmetry.github.io/qaf/latest/gherkin_client.html) it generates testng XML configuration for failed scenarios that you can use for rerun. It also support scenario rerun on fail by setting `retry.count` property.

[Share](/a/50553669 "Short permalink to this answer")

[Improve this answer](/posts/50553669/edit)

Follow 

answered May 27, 2018 at 15:26

[![user861594's user avatar](https://www.gravatar.com/avatar/5c5bd816221582ff949ae3ce6ab7d29b?s=64&d=identicon&r=PG)](/users/861594/user861594)

[user861594](/users/861594/user861594)user861594

5,91833 gold badges3131 silver badges4646 bronze badges




Add a comment  | 

0 

[](/posts/58745232/timeline "Show activity on this post.")

using Cucumber + Maven + TestNG first, you don't need "`@RunWith(Cucumber.class)`" as you have mentioned in your question, if you are using TestNG, only `"@CucumberOptions"` is required. When you start your test execution, all scenario failures will be written to file `"target/rerun.txt"` as per the configuration mentioned in your Runner file. Now, you need to create one more Runner file (for example - "FailureRunner") and in this file provide the path of `"@target/rerun.txt"` ( this already have the details of the failure scenarios ) as -> `features = { "@target/rerun.txt" }`

Now, you need to UPDATE your TestNG.xml file and include the "FailureRunner" as below- 
    
    
        <class name="Class path of Your First Runner Class name" />
        <class name="class path of FailureRunner Class" />
    

Once you do all the above steps and run your execution, the first execution will write the failure scenarios in the `"target/rerun.txt"` and After that, the "FailureRunner" Class will be executed which will pick up the `"@target/rerun.txt"` file and Hence, Failure scenarios will be executed.

I have executed in the same way and it works fine, let me know if it helps !!

[Share](/a/58745232 "Short permalink to this answer")

[Improve this answer](/posts/58745232/edit)

Follow 

[edited Nov 7, 2019 at 9:11](/posts/58745232/revisions "show all edits to this post")

answered Nov 7, 2019 at 9:03

[![Anoop Singh's user avatar](https://www.gravatar.com/avatar/a8d996a3c27d4be742404357536093f8?s=64&d=identicon&r=PG&f=y&so-version=2)](/users/12312094/anoop-singh)

[Anoop Singh](/users/12312094/anoop-singh)Anoop Singh

2944 bronze badges

1

  * In this case Both Runner Classes start executing parallely

- [Suraj Gupta](/users/5601285/suraj-gupta "398 reputation")

Commented Oct 14, 2020 at 12:13




Add a comment  | 

**[Highly active question](/help/privileges/protect-questions)**. Earn 10 reputation (not counting the [association bonus](https://meta.stackexchange.com/questions/141648/what-is-the-association-bonus-and-how-does-it-work)) in order to answer this question. The reputation requirement helps protect this question from spam and non-answer activity. 

Start asking to get answers

Find the answer to your question by asking.

[Ask question](/questions/ask)

Explore related questions

  * [testing](/questions/tagged/testing "show questions tagged 'testing'")
  * [cucumber-java](/questions/tagged/cucumber-java "show questions tagged 'cucumber-java'")



See similar questions with these tags.

  * The Overflow Blog 
  * [To get ahead with AI, fine-tune your data strategy](https://stackoverflow.blog/2025/03/17/to-get-ahead-with-ai-fine-tune-your-data-strategy/)

  * [Improving error monitoring with AI](https://stackoverflow.blog/2025/03/18/improving-error-monitoring-with-ai/)

  * Featured on Meta 
  * [Community Asks Sprint Announcement - March 2025](https://meta.stackexchange.com/questions/407321/community-asks-sprint-announcement-march-2025)

  * [Experimenting with a new experiment opt-out option](https://meta.stackexchange.com/questions/407547/experimenting-with-a-new-experiment-opt-out-option)

  * [Stacks Editor development and testing](https://meta.stackoverflow.com/questions/433034/stacks-editor-development-and-testing)

  * [Policy: Generative AI (e.g., ChatGPT) is banned](https://meta.stackoverflow.com/questions/421831/policy-generative-ai-e-g-chatgpt-is-banned)

  * [Is it better to redirect users who attempt to perform actions they can't yet...](https://meta.stackoverflow.com/questions/432989/is-it-better-to-redirect-users-who-attempt-to-perform-actions-they-cant-yet-tak "Is it better to redirect users who attempt to perform actions they can't yet take?")




#### Linked

[ 46 ](/q/11719898 "Question score \(upvotes - downvotes\)") [How to rerun the failed scenarios using Cucumber?](/questions/11719898/how-to-rerun-the-failed-scenarios-using-cucumber?noredirect=1)

#### Related

[ 0 ](/q/798188 "Question score \(upvotes - downvotes\)") [Is there a way to tell cucumber not to skip other tests in a scenario when a test fail?](/questions/798188/is-there-a-way-to-tell-cucumber-not-to-skip-other-tests-in-a-scenario-when-a-tes)

[ 46 ](/q/11719898 "Question score \(upvotes - downvotes\)") [How to rerun the failed scenarios using Cucumber?](/questions/11719898/how-to-rerun-the-failed-scenarios-using-cucumber)

[ 11 ](/q/21334207 "Question score \(upvotes - downvotes\)") [Rerunning failed cucumber tests using cucumber-jvm](/questions/21334207/rerunning-failed-cucumber-tests-using-cucumber-jvm)

[ 1 ](/q/29644231 "Question score \(upvotes - downvotes\)") [How to rerun failed test cases in cucumber-jvm?](/questions/29644231/how-to-rerun-failed-test-cases-in-cucumber-jvm)

[ 3 ](/q/40676750 "Question score \(upvotes - downvotes\)") [How to fail a cucumber scenario](/questions/40676750/how-to-fail-a-cucumber-scenario)

[ 5 ](/q/49260902 "Question score \(upvotes - downvotes\)") [How to skip all cucumber-jvm scenarios when first scenario is failed](/questions/49260902/how-to-skip-all-cucumber-jvm-scenarios-when-first-scenario-is-failed)

[ 1 ](/q/55282887 "Question score \(upvotes - downvotes\)") [Stopping the execution if first scenario fails in QAF - Cucumber](/questions/55282887/stopping-the-execution-if-first-scenario-fails-in-qaf-cucumber)

[ 1 ](/q/56630835 "Question score \(upvotes - downvotes\)") [How do I re run failed Cucumber scenarios from Maven?](/questions/56630835/how-do-i-re-run-failed-cucumber-scenarios-from-maven)

[ 2 ](/q/57325277 "Question score \(upvotes - downvotes\)") [Cucumber rerun failed tests and cocatenate results using a testNG runner for cucumber 4.x](/questions/57325277/cucumber-rerun-failed-tests-and-cocatenate-results-using-a-testng-runner-for-cuc)

[ 0 ](/q/66696183 "Question score \(upvotes - downvotes\)") [rerun failed tests junit5 cucumber](/questions/66696183/rerun-failed-tests-junit5-cucumber)

####  [ Hot Network Questions ](https://stackexchange.com/questions?tab=hot)

  * [ Can you connect two adjustable duct elbows together? ](https://diy.stackexchange.com/questions/315938/can-you-connect-two-adjustable-duct-elbows-together)
  * [ Do pentesters need to be able to fix their findings for their customers? ](https://security.stackexchange.com/questions/280837/do-pentesters-need-to-be-able-to-fix-their-findings-for-their-customers)
  * [ N Dice problem with Sum and Disivibility ](https://mathematica.stackexchange.com/questions/311609/n-dice-problem-with-sum-and-disivibility)
  * [ Lucas sequence inequality ](https://math.stackexchange.com/questions/5046727/lucas-sequence-inequality)
  * [ Clustered Index Update operator performing excessive Logical Reads after query change ](https://dba.stackexchange.com/questions/345758/clustered-index-update-operator-performing-excessive-logical-reads-after-query-c)
  * [ Universality all the way down? ](https://cs.stackexchange.com/questions/171513/universality-all-the-way-down)
  * [ How many independent global hotel search engines are there? ](https://travel.stackexchange.com/questions/193772/how-many-independent-global-hotel-search-engines-are-there)
  * [ Do I ground IC pins marked "NC" in its datasheet? ](https://electronics.stackexchange.com/questions/741595/do-i-ground-ic-pins-marked-nc-in-its-datasheet)
  * [ Can I use the same wooden cutting board for vegetables and meat if I cut the vegetables first? ](https://cooking.stackexchange.com/questions/130354/can-i-use-the-same-wooden-cutting-board-for-vegetables-and-meat-if-i-cut-the-veg)
  * [ How does a receiver recognize and handle a block of ciphertext as being "unsynchronized" in a self-synchronizing stream cipher? ](https://crypto.stackexchange.com/questions/114604/how-does-a-receiver-recognize-and-handle-a-block-of-ciphertext-as-being-unsynch)
  * [ Validity of presidential orders "signed" with an "autopen" machine ](https://law.stackexchange.com/questions/107828/validity-of-presidential-orders-signed-with-an-autopen-machine)
  * [ rotate a defined object ](https://tex.stackexchange.com/questions/739185/rotate-a-defined-object)
  * [ Simplest problems showing that "Spec Z is where schemes really shine" ](https://math.stackexchange.com/questions/5046936/simplest-problems-showing-that-spec-z-is-where-schemes-really-shine)
  * [ A pet in a city ](https://puzzling.stackexchange.com/questions/131008/a-pet-in-a-city)
  * [ A type theory for curried functions with named/labeled arguments ](https://cstheory.stackexchange.com/questions/55211/a-type-theory-for-curried-functions-with-named-labeled-arguments)
  * [ What are these pom pom trees? ](https://gardening.stackexchange.com/questions/67799/what-are-these-pom-pom-trees)
  * [ Dataset links provided in the paper not working, authors not responding, next steps? ](https://academia.stackexchange.com/questions/217418/dataset-links-provided-in-the-paper-not-working-authors-not-responding-next-st)
  * [ Matrix factorization of higher length ](https://mathoverflow.net/questions/489604/matrix-factorization-of-higher-length)
  * [ Distributing a library under a license different than its examples ](https://opensource.stackexchange.com/questions/15411/distributing-a-library-under-a-license-different-than-its-examples)
  * [ Ethernet over double RJ11 ](https://superuser.com/questions/1886962/ethernet-over-double-rj11)
  * [ Post-2005 third-person "walking simulator" video game about exploring an abandoned space colony ](https://scifi.stackexchange.com/questions/295515/post-2005-third-person-walking-simulator-video-game-about-exploring-an-abandon)
  * [ Is there a word for a shift in a road where it remains parallel to its original direction? ](https://english.stackexchange.com/questions/629981/is-there-a-word-for-a-shift-in-a-road-where-it-remains-parallel-to-its-original)
  * [ Trace distance under quantum gates and measurements ](https://quantumcomputing.stackexchange.com/questions/41464/trace-distance-under-quantum-gates-and-measurements)
  * [ How would humans need to adapt in order to survive in overgrown world? ](https://worldbuilding.stackexchange.com/questions/265367/how-would-humans-need-to-adapt-in-order-to-survive-in-overgrown-world)

more hot questions 

[ Question feed ](/feeds/question/48660585 "Feed of this question and its answers")

#  Subscribe to RSS 

Question feed 

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

![](/posts/48660585/ivc/76f2?prg=efc1794a-42a4-48c9-afa4-c3521a1e0f6c)

[](https://stackoverflow.com)

##### [Stack Overflow](https://stackoverflow.com)

  * [Questions](/questions)
  * [Help](/help)
  * [Chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)



##### [Products](https://stackoverflow.co/)

  * [Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=teams)
  * [Advertising](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=advertising)
  * [Talent](https://stackoverflow.co/advertising/employer-branding/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=talent)



##### [Company](https://stackoverflow.co/)

  * [About](https://stackoverflow.co/)
  * [Press](https://stackoverflow.co/company/press/)
  * [Work Here](https://stackoverflow.co/company/work-here/)
  * [Legal](https://stackoverflow.com/legal)
  * [Privacy Policy](https://stackoverflow.com/legal/privacy-policy)
  * [Terms of Service](https://stackoverflow.com/legal/terms-of-service/public)
  * [Contact Us](/contact)
  * Your Privacy Choices 
  * [Cookie Policy](https://stackoverflow.com/legal/cookie-policy)



##### [Stack Exchange Network](https://stackexchange.com)

  * [ Technology ](https://stackexchange.com/sites#technology)
  * [ Culture & recreation ](https://stackexchange.com/sites#culturerecreation)
  * [ Life & arts ](https://stackexchange.com/sites#lifearts)
  * [ Science ](https://stackexchange.com/sites#science)
  * [ Professional ](https://stackexchange.com/sites#professional)
  * [ Business ](https://stackexchange.com/sites#business)
  * [ API ](https://api.stackexchange.com/)
  * [ Data ](https://data.stackexchange.com/)



  * [Blog](https://stackoverflow.blog?blb=1)
  * [Facebook](https://www.facebook.com/officialstackoverflow/)
  * [Twitter](https://twitter.com/stackoverflow)
  * [LinkedIn](https://linkedin.com/company/stack-overflow)
  * [Instagram](https://www.instagram.com/thestackoverflow)



Site design / logo © 2025 Stack Exchange Inc;  user contributions licensed under  [CC BY-SA](https://stackoverflow.com/help/licensing) .  rev 2025.3.17.23948


title: android - Flutter- Front camera preview is getting mirrored on some devices - Stack Overflow
scrape_date: 2025-03-18T12:03:06.375870
content_type: markdown
hash: 952d3feafe1c7c38ca4df5286977704612becf04d53ea82b7ea5129e66c7748e
url:
https://stackoverflow.com/questions/79518190/flutter-front-camera-preview-is-getting-mirrored-on-some-devices

content:
Skip to main content

[ Stack Overflow ](https://stackoverflow.com)

  1. [About](https://stackoverflow.co/)
  2. Products 
  3. [OverflowAI](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav-bar&utm_content=overflowai)



  1. [ Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers ](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-for-teams)
  2. [ Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand ](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-advertising)
  3. [ OverflowAI GenAI features for Teams ](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-ai)
  4. [ OverflowAPI Train & fine-tune LLMs ](https://stackoverflow.co/api-solutions/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-api)
  5. [ Labs The future of collective knowledge sharing ](https://stackoverflow.co/labs/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=labs)
  6. [About the company](https://stackoverflow.co/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=about-the-company) [Visit the blog](https://stackoverflow.blog/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=blog)



Loading…

  1. ###  [current community](https://stackoverflow.com)

     * [ Stack Overflow  ](https://stackoverflow.com)

[help](https://stackoverflow.com/help) [chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)

     * [ Meta Stack Overflow  ](https://meta.stackoverflow.com)

###  your communities 

[Sign up](https://stackoverflow.com/users/signup?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518190%2fflutter-front-camera-preview-is-getting-mirrored-on-some-devices) or [log in](https://stackoverflow.com/users/login?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518190%2fflutter-front-camera-preview-is-getting-mirrored-on-some-devices) to customize your list. 

### [more stack exchange communities](https://stackexchange.com/sites)

[company blog](https://stackoverflow.blog)

  2.   3. [Log in](https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518190%2fflutter-front-camera-preview-is-getting-mirrored-on-some-devices)
  4. [Sign up](https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518190%2fflutter-front-camera-preview-is-getting-mirrored-on-some-devices)



  1.     1. [ Home ](/)
    2. [ Questions ](/questions)
    3. [ Tags ](/tags)
    4.     5. [ Users ](/users)
    6. [ Companies ](https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav)
    7. [ Labs ](javascript:void\(0\))
    8. [ Jobs ](/jobs?source=so-left-nav)
    9. [ Discussions ](/beta/discussions)
    10. [ Collectives ](javascript:void\(0\))

    11. Communities for your favorite technologies. [Explore all Collectives](/collectives-all)

  2. Teams

![](https://cdn.sstatic.net/Img/teams/teams-promo.svg?v=e507948b81bf)

Ask questions, find answers and collaborate at work with Stack Overflow for Teams. 

[Try Teams for free](https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams)

  3. [ Teams ](javascript:void\(0\))
  4. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact)




##### Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

[ Learn more about Collectives ](/collectives)

**Teams**

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

[ Learn more about Teams ](https://stackoverflow.co/teams/)

Get early access and see previews of new features.

[ Learn more about Labs](https://stackoverflow.co/labs/)

# [Flutter- Front camera preview is getting mirrored on some devices](/questions/79518190/flutter-front-camera-preview-is-getting-mirrored-on-some-devices)

[ Ask Question ](/questions/ask)

Asked today

Modified [today](?lastactivity "2025-03-18 17:01:03Z")

Viewed 3 times 

Part of [Mobile Development](/collectives/mobile-dev) Collective 

0 

[](/posts/79518190/timeline "Show activity on this post.")

Fromt camera preview is getting mirrored on some devices

I have upgraded the camera package to the latest version (0.11) with Flutter SDK 3.27.4.

Tested on a physical device with the expected result: Android 11: OnePlus 6T.

Tested on a physical device with an unexpected result: Android 14: OnePlus Nord N30 (Front camera preview appears mirrored).

How can I prevent the front camera preview from being mirrored across all Android devices?

[](/collectives/mobile-dev "Mobile Development Collective")

  * [android](/questions/tagged/android "show questions tagged 'android'")
  * [flutter](/questions/tagged/flutter "show questions tagged 'flutter'")
  * [android-camerax](/questions/tagged/android-camerax "show questions tagged 'android-camerax'")
  * [flutter-camera](/questions/tagged/flutter-camera "show questions tagged 'flutter-camera'")



[Share](/q/79518190 "Short permalink to this question")

Follow 

asked 2 mins ago

[![Fahim Shahriyar's user avatar](https://i.sstatic.net/emsGJ.jpg?s=64)](/users/13521141/fahim-shahriyar)

[Fahim Shahriyar](/users/13521141/fahim-shahriyar)Fahim Shahriyar

4111 silver badge33 bronze badges




Add a comment  | 

Related questions

[ 0  Camera X - Accessing both Front and Back Cameras simultaneously using Camera X API ](/questions/66261126/camera-x-accessing-both-front-and-back-cameras-simultaneously-using-camera-x-a)

[ 2  Camera Preview Stretched on Front Facing Camera ](/questions/38500488/camera-preview-stretched-on-front-facing-camera)

[ 0  Camera Preview performance issue on some devices ](/questions/38616287/camera-preview-performance-issue-on-some-devices)

Related questions

[ 0  Camera X - Accessing both Front and Back Cameras simultaneously using Camera X API ](/questions/66261126/camera-x-accessing-both-front-and-back-cameras-simultaneously-using-camera-x-a)

[ 2  Camera Preview Stretched on Front Facing Camera ](/questions/38500488/camera-preview-stretched-on-front-facing-camera)

[ 0  Camera Preview performance issue on some devices ](/questions/38616287/camera-preview-performance-issue-on-some-devices)

[ 19  Android front camera ](/questions/6098729/android-front-camera)

[ 1  getSupportedPreviewSizes() for Motorola Xoom front camera (and other devices) ](/questions/6459158/getsupportedpreviewsizes-for-motorola-xoom-front-camera-and-other-devices)

[ 473  Why does an image captured using camera intent gets rotated on some devices on Android? ](/questions/14066038/why-does-an-image-captured-using-camera-intent-gets-rotated-on-some-devices-on-a)

[ 651  I am getting error "cmdline-tools component is missing" after installing Flutter and Android Studio... I added the Android SDK. How can I solve them? ](/questions/68236007/i-am-getting-error-cmdline-tools-component-is-missing-after-installing-flutter)

Load 4 more related questions  Show fewer related questions 

##  0

Sorted by:  [ Reset to default ](/questions/79518190/flutter-front-camera-preview-is-getting-mirrored-on-some-devices?answertab=scoredesc#tab-top)

Highest score (default)  Trending (recent votes count more)  Date modified (newest first)  Date created (oldest first) 

##  Know someone who can answer? Share a link to this [question](https://stackoverflow.com/questions/79518190/flutter-front-camera-preview-is-getting-mirrored-on-some-devices) via [email](/cdn-cgi/l/email-protection#1c236f697e76797f68214f687d7f77392e2c536a796e7a70736b392e2c4d69796f687573723a7d716c277e737865215a70696868796e31392e2c5a6e737268392e2c7f7d71796e7d392e2c6c6e796a75796b392e2c756f392e2c7b79686875727b392e2c71756e6e736e7978392e2c7372392e2c6f737179392e2c78796a757f796f392c5d7468686c6f392f7d392e7a392e7a6f687d7f77736a796e7a70736b327f7371392e7a6d392e7a2b25292d242d252c392f7a6f7971392f782e), [Twitter](https://twitter.com/share?url=https%3a%2f%2fstackoverflow.com%2fq%2f79518190%3fstw%3d2), or [Facebook](https://www.facebook.com/sharer.php?u=https%3a%2f%2fstackoverflow.com%2fq%2f79518190%3fsfb%3d2). 

##  Your Answer 

Thanks for contributing an answer to Stack Overflow!

  * Please be sure to _answer the question_. Provide details and share your research!



But _avoid_ …

  * Asking for help, clarification, or responding to other answers.
  * Making statements based on opinion; back them up with references or personal experience.



To learn more, see our [tips on writing great answers](/help/how-to-answer).

Draft saved

Draft discarded

### Sign up or [log in](/users/login?ssrc=question_page&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518190%2fflutter-front-camera-preview-is-getting-mirrored-on-some-devices%23new-answer)

Sign up using Google 

Sign up using Email and Password 

Submit

### Post as a guest

Name

Email

Required, but never shown

### Post as a guest

Name

Email

Required, but never shown

Post Your Answer  Discard 

By clicking “Post Your Answer”, you agree to our [terms of service](https://stackoverflow.com/legal/terms-of-service/public) and acknowledge you have read our [privacy policy](https://stackoverflow.com/legal/privacy-policy).

Start asking to get answers

Find the answer to your question by asking.

[Ask question](/questions/ask)

Explore related questions

  * [android](/questions/tagged/android "show questions tagged 'android'")
  * [flutter](/questions/tagged/flutter "show questions tagged 'flutter'")
  * [android-camerax](/questions/tagged/android-camerax "show questions tagged 'android-camerax'")
  * [flutter-camera](/questions/tagged/flutter-camera "show questions tagged 'flutter-camera'")



See similar questions with these tags.

[ Mobile Development Collective Join the discussion ](/collectives/mobile-dev/beta/discussions)

[ This question is in a collective:](/collectives) a subcommunity defined by tags with relevant content and experts. 

  * The Overflow Blog 
  * [To get ahead with AI, fine-tune your data strategy](https://stackoverflow.blog/2025/03/17/to-get-ahead-with-ai-fine-tune-your-data-strategy/)

  * [Improving error monitoring with AI](https://stackoverflow.blog/2025/03/18/improving-error-monitoring-with-ai/)

  * Featured on Meta 
  * [Community Asks Sprint Announcement - March 2025](https://meta.stackexchange.com/questions/407321/community-asks-sprint-announcement-march-2025)

  * [Experimenting with a new experiment opt-out option](https://meta.stackexchange.com/questions/407547/experimenting-with-a-new-experiment-opt-out-option)

  * [Stacks Editor development and testing](https://meta.stackoverflow.com/questions/433034/stacks-editor-development-and-testing)

  * [Policy: Generative AI (e.g., ChatGPT) is banned](https://meta.stackoverflow.com/questions/421831/policy-generative-ai-e-g-chatgpt-is-banned)

  * [Is it better to redirect users who attempt to perform actions they can't yet...](https://meta.stackoverflow.com/questions/432989/is-it-better-to-redirect-users-who-attempt-to-perform-actions-they-cant-yet-tak "Is it better to redirect users who attempt to perform actions they can't yet take?")




####  [ Hot Network Questions ](https://stackexchange.com/questions?tab=hot)

  * [ PMOS Gate Drive in Typical Application Circuit ](https://electronics.stackexchange.com/questions/741796/pmos-gate-drive-in-typical-application-circuit)
  * [ Adverb over: clothes ](https://ell.stackexchange.com/questions/363292/adverb-over-clothes)
  * [ Is there a word for a shift in a road where it remains parallel to its original direction? ](https://english.stackexchange.com/questions/629981/is-there-a-word-for-a-shift-in-a-road-where-it-remains-parallel-to-its-original)
  * [ What are the differences in Artscroll editions of Chumash and Tanakh? ](https://judaism.stackexchange.com/questions/148304/what-are-the-differences-in-artscroll-editions-of-chumash-and-tanakh)
  * [ Starting with a pile of 1,001 rocks, discarding some and splitting up the piles, can you eventually have all piles with exactly 3 rocks? ](https://puzzling.stackexchange.com/questions/130977/starting-with-a-pile-of-1-001-rocks-discarding-some-and-splitting-up-the-piles)
  * [ Can you connect two adjustable duct elbows together? ](https://diy.stackexchange.com/questions/315938/can-you-connect-two-adjustable-duct-elbows-together)
  * [ What is the purpose of DPMI interrupt 31h function 300h? ](https://retrocomputing.stackexchange.com/questions/31426/what-is-the-purpose-of-dpmi-interrupt-31h-function-300h)
  * [ What does tying up the strongman mean in Matthew 12? ](https://hermeneutics.stackexchange.com/questions/102376/what-does-tying-up-the-strongman-mean-in-matthew-12)
  * [ What size breaker do I need for a 31.25 Amp heater? ](https://diy.stackexchange.com/questions/315950/what-size-breaker-do-i-need-for-a-31-25-amp-heater)
  * [ The time management of teaching v research ](https://academia.stackexchange.com/questions/217411/the-time-management-of-teaching-v-research)
  * [ CEO of startup is becoming more and more incoherent ](https://workplace.stackexchange.com/questions/200561/ceo-of-startup-is-becoming-more-and-more-incoherent)
  * [ What is the difference between non existence and existence outside of space and time? ](https://philosophy.stackexchange.com/questions/123524/what-is-the-difference-between-non-existence-and-existence-outside-of-space-and)
  * [ What is the 'real-world' meaning of a mediation effect? ](https://stats.stackexchange.com/questions/662764/what-is-the-real-world-meaning-of-a-mediation-effect)
  * [ magento 2.4 get list of all admin roles ](https://magento.stackexchange.com/questions/376547/magento-2-4-get-list-of-all-admin-roles)
  * [ Can we still use the word "tweet" now that Twitter has been rebranded as X? ](https://ell.stackexchange.com/questions/363209/can-we-still-use-the-word-tweet-now-that-twitter-has-been-rebranded-as-x)
  * [ Is this an acceptable workaround to mounting a rear cargo rack around the rear brake? ](https://bicycles.stackexchange.com/questions/96386/is-this-an-acceptable-workaround-to-mounting-a-rear-cargo-rack-around-the-rear-b)
  * [ Unless in conditional sentences ](https://ell.stackexchange.com/questions/363259/unless-in-conditional-sentences)
  * [ Equivalent English for a Gujarati saying paraphrased as "Goldsmithing proved costlier than the gold" ](https://english.stackexchange.com/questions/630087/equivalent-english-for-a-gujarati-saying-paraphrased-as-goldsmithing-proved-cos)
  * [ A type theory for curried functions with named/labeled arguments ](https://cstheory.stackexchange.com/questions/55211/a-type-theory-for-curried-functions-with-named-labeled-arguments)
  * [ Is there anything like RMS for capacitor or inductor? ](https://electronics.stackexchange.com/questions/741754/is-there-anything-like-rms-for-capacitor-or-inductor)
  * [ Why ever hammer a BB rather than turn to push it out? ](https://bicycles.stackexchange.com/questions/96384/why-ever-hammer-a-bb-rather-than-turn-to-push-it-out)
  * [ What is a 'Phlegm dealership'? ](https://movies.stackexchange.com/questions/124871/what-is-a-phlegm-dealership)
  * [ Debugging a performance issue, do I commit the timing code? ](https://softwareengineering.stackexchange.com/questions/456868/debugging-a-performance-issue-do-i-commit-the-timing-code)
  * [ Minimizing the Sum of Elementwise Products for Three Permutations of a Sequence ](https://math.stackexchange.com/questions/5046871/minimizing-the-sum-of-elementwise-products-for-three-permutations-of-a-sequence)

more hot questions 

[ Question feed ](/feeds/question/79518190 "Feed of this question and its answers")

#  Subscribe to RSS 

Question feed 

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

![](/posts/79518190/ivc/76f2?prg=c4c66d46-7d6d-4c9c-8568-8b4874ac6871)

lang-dart

[](https://stackoverflow.com)

##### [Stack Overflow](https://stackoverflow.com)

  * [Questions](/questions)
  * [Help](/help)
  * [Chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)



##### [Products](https://stackoverflow.co/)

  * [Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=teams)
  * [Advertising](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=advertising)
  * [Talent](https://stackoverflow.co/advertising/employer-branding/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=talent)



##### [Company](https://stackoverflow.co/)

  * [About](https://stackoverflow.co/)
  * [Press](https://stackoverflow.co/company/press/)
  * [Work Here](https://stackoverflow.co/company/work-here/)
  * [Legal](https://stackoverflow.com/legal)
  * [Privacy Policy](https://stackoverflow.com/legal/privacy-policy)
  * [Terms of Service](https://stackoverflow.com/legal/terms-of-service/public)
  * [Contact Us](/contact)
  * Your Privacy Choices 
  * [Cookie Policy](https://stackoverflow.com/legal/cookie-policy)



##### [Stack Exchange Network](https://stackexchange.com)

  * [ Technology ](https://stackexchange.com/sites#technology)
  * [ Culture & recreation ](https://stackexchange.com/sites#culturerecreation)
  * [ Life & arts ](https://stackexchange.com/sites#lifearts)
  * [ Science ](https://stackexchange.com/sites#science)
  * [ Professional ](https://stackexchange.com/sites#professional)
  * [ Business ](https://stackexchange.com/sites#business)
  * [ API ](https://api.stackexchange.com/)
  * [ Data ](https://data.stackexchange.com/)



  * [Blog](https://stackoverflow.blog?blb=1)
  * [Facebook](https://www.facebook.com/officialstackoverflow/)
  * [Twitter](https://twitter.com/stackoverflow)
  * [LinkedIn](https://linkedin.com/company/stack-overflow)
  * [Instagram](https://www.instagram.com/thestackoverflow)



Site design / logo © 2025 Stack Exchange Inc;  user contributions licensed under  [CC BY-SA](https://stackoverflow.com/help/licensing) .  rev 2025.3.17.23948


url: https://stackoverflow.com/questions/79518187/aggregated-sub-total-within-column
title: reporting services - Aggregated sub-total within column - Stack Overflow
scrape_date: 2025-03-18T12:03:06.375476
content_type: markdown
hash: e9be90094df33cb79749dd9a9222b431007c075a0b6e741fa389dfc08471fc21
content:
Skip to main content

[ Stack Overflow ](https://stackoverflow.com)

  1. [About](https://stackoverflow.co/)
  2. Products 
  3. [OverflowAI](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav-bar&utm_content=overflowai)



  1. [ Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers ](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-for-teams)
  2. [ Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand ](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-advertising)
  3. [ OverflowAI GenAI features for Teams ](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-ai)
  4. [ OverflowAPI Train & fine-tune LLMs ](https://stackoverflow.co/api-solutions/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-api)
  5. [ Labs The future of collective knowledge sharing ](https://stackoverflow.co/labs/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=labs)
  6. [About the company](https://stackoverflow.co/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=about-the-company) [Visit the blog](https://stackoverflow.blog/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=blog)



Loading…

  1. ###  [current community](https://stackoverflow.com)

     * [ Stack Overflow  ](https://stackoverflow.com)

[help](https://stackoverflow.com/help) [chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)

     * [ Meta Stack Overflow  ](https://meta.stackoverflow.com)

###  your communities 

[Sign up](https://stackoverflow.com/users/signup?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518187%2faggregated-sub-total-within-column) or [log in](https://stackoverflow.com/users/login?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518187%2faggregated-sub-total-within-column) to customize your list. 

### [more stack exchange communities](https://stackexchange.com/sites)

[company blog](https://stackoverflow.blog)

  2.   3. [Log in](https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518187%2faggregated-sub-total-within-column)
  4. [Sign up](https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518187%2faggregated-sub-total-within-column)



  1.     1. [ Home ](/)
    2. [ Questions ](/questions)
    3. [ Tags ](/tags)
    4.     5. [ Users ](/users)
    6. [ Companies ](https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav)
    7. [ Labs ](javascript:void\(0\))
    8. [ Jobs ](/jobs?source=so-left-nav)
    9. [ Discussions ](/beta/discussions)
    10. [ Collectives ](javascript:void\(0\))

    11. Communities for your favorite technologies. [Explore all Collectives](/collectives-all)

  2. Teams

![](https://cdn.sstatic.net/Img/teams/teams-promo.svg?v=e507948b81bf)

Ask questions, find answers and collaborate at work with Stack Overflow for Teams. 

[Try Teams for free](https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams)

  3. [ Teams ](javascript:void\(0\))
  4. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact)




##### Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

[ Learn more about Collectives ](/collectives)

**Teams**

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

[ Learn more about Teams ](https://stackoverflow.co/teams/)

Get early access and see previews of new features.

[ Learn more about Labs](https://stackoverflow.co/labs/)

# [Aggregated sub-total within column](/questions/79518187/aggregated-sub-total-within-column)

[ Ask Question ](/questions/ask)

Asked today

Modified [today](?lastactivity "2025-03-18 17:01:18Z")

Viewed 4 times 

0 

[](/posts/79518187/timeline "Show activity on this post.")

I have a detail TABLE, that I'd like to generate a sub-total for each value in a column. I have a data table that records a number (key). I have a reference table that has key/value pairs. On occasion, we add values to the reference table, and the value becomes available to the db detail table.

At each sub-grouping, I'd like to list the values, and their counts for the group. But I don't want to hard code these values. I don't want to have to make changes to the report. If we get new reference values, or the wording for an existing reference value changes, the report should be dynamic enough to pick up the changes.

[![Subtotal of column values](https://i.sstatic.net/JpgTBfz2.png)](https://i.sstatic.net/JpgTBfz2.png)

Currently, I'm having to hard code the reference values:
    
    
    =sum(IIF(Fields!meal.Value = "1", 1, 0)).ToString & chr(10) & chr(13) &
     sum(IIF(Fields!meal.Value = "2", 1, 0)).ToString & chr(10) & chr(13) &
     sum(IIF(Fields!meal.Value = "3", 1, 0)).ToString & chr(10) & chr(13) &
     sum(IIF(Fields!meal.Value = "4", 1, 0)).ToString & chr(10) & chr(13) &
     sum(IIF(Fields!meal.Value = "5", 1, 0)).ToString & chr(10) & chr(13) &
     sum(IIF(Fields!meal.Value = "6", 1, 0)).ToString & chr(10) & chr(13)
    

How can I make this dynamic enough I don't have to touch it again? If I can get the above working, I can use the same logic to do a look up on the key to populate the column in green next to the counts.

  * [reporting-services](/questions/tagged/reporting-services "show questions tagged 'reporting-services'")
  * [ssrs-2012](/questions/tagged/ssrs-2012 "show questions tagged 'ssrs-2012'")



[Share](/q/79518187 "Short permalink to this question")

Follow 

[edited 1 min ago](/posts/79518187/revisions "show all edits to this post")

[![jonrsharpe's user avatar](https://i.sstatic.net/feZwC.jpg?s=64)](/users/3001761/jonrsharpe)

[jonrsharpe](/users/3001761/jonrsharpe)

122k3030 gold badges267267 silver badges474474 bronze badges

asked 2 mins ago

[![ARLibertarian's user avatar](https://www.gravatar.com/avatar/a18c35755e5f5ea024ed36531b08daff?s=64&d=identicon&r=PG)](/users/653969/arlibertarian)

[ARLibertarian](/users/653969/arlibertarian)ARLibertarian

16722 silver badges1212 bronze badges




Add a comment  | 

Related questions

[ 0  column value comparison and fill color change based on the expression ](/questions/56246557/column-value-comparison-and-fill-color-change-based-on-the-expression)

[ 0  Expression outside of a tablix ](/questions/78077734/expression-outside-of-a-tablix)

[ 0  SSRS Use the text field only in a specific value the parameter ](/questions/51594653/ssrs-use-the-text-field-only-in-a-specific-value-the-parameter)

Related questions

[ 0  column value comparison and fill color change based on the expression ](/questions/56246557/column-value-comparison-and-fill-color-change-based-on-the-expression)

[ 0  Expression outside of a tablix ](/questions/78077734/expression-outside-of-a-tablix)

[ 0  SSRS Use the text field only in a specific value the parameter ](/questions/51594653/ssrs-use-the-text-field-only-in-a-specific-value-the-parameter)

[ 0  how to sum time column and avoid null fields in ssrs 2008 ](/questions/28659683/how-to-sum-time-column-and-avoid-null-fields-in-ssrs-2008)

[ 0  Summing a column of expressions in SSRS (total sum) ](/questions/67813933/summing-a-column-of-expressions-in-ssrs-total-sum)

[ 0  How to write an expression two calculate sum of values if gender is equal to Male and Female in SSRS? ](/questions/72166458/how-to-write-an-expression-two-calculate-sum-of-values-if-gender-is-equal-to-mal)

Load 3 more related questions  Show fewer related questions 

##  0

Sorted by:  [ Reset to default ](/questions/79518187/aggregated-sub-total-within-column?answertab=scoredesc#tab-top)

Highest score (default)  Trending (recent votes count more)  Date modified (newest first)  Date created (oldest first) 

##  Know someone who can answer? Share a link to this [question](https://stackoverflow.com/questions/79518187/aggregated-sub-total-within-column) via [email](/cdn-cgi/l/email-protection#221d515740484741561f71564341490710126d544750444e4d5507101273574751564b4d4c04434f5219404d465b1f634545504745435647460710125157400f564d56434e071012554b564a4b4c071012414d4e574f4c0712634a5656525107114307104407104451564341494d544750444e4d550c414d4f07104453071044151b17131a131a1507114451474f07114610), [Twitter](https://twitter.com/share?url=https%3a%2f%2fstackoverflow.com%2fq%2f79518187%3fstw%3d2), or [Facebook](https://www.facebook.com/sharer.php?u=https%3a%2f%2fstackoverflow.com%2fq%2f79518187%3fsfb%3d2). 

##  Your Answer 

Thanks for contributing an answer to Stack Overflow!

  * Please be sure to _answer the question_. Provide details and share your research!



But _avoid_ …

  * Asking for help, clarification, or responding to other answers.
  * Making statements based on opinion; back them up with references or personal experience.



To learn more, see our [tips on writing great answers](/help/how-to-answer).

Draft saved

Draft discarded

### Sign up or [log in](/users/login?ssrc=question_page&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518187%2faggregated-sub-total-within-column%23new-answer)

Sign up using Google 

Sign up using Email and Password 

Submit

### Post as a guest

Name

Email

Required, but never shown

### Post as a guest

Name

Email

Required, but never shown

Post Your Answer  Discard 

By clicking “Post Your Answer”, you agree to our [terms of service](https://stackoverflow.com/legal/terms-of-service/public) and acknowledge you have read our [privacy policy](https://stackoverflow.com/legal/privacy-policy).

Start asking to get answers

Find the answer to your question by asking.

[Ask question](/questions/ask)

Explore related questions

  * [reporting-services](/questions/tagged/reporting-services "show questions tagged 'reporting-services'")
  * [ssrs-2012](/questions/tagged/ssrs-2012 "show questions tagged 'ssrs-2012'")



See similar questions with these tags.

  * The Overflow Blog 
  * [To get ahead with AI, fine-tune your data strategy](https://stackoverflow.blog/2025/03/17/to-get-ahead-with-ai-fine-tune-your-data-strategy/)

  * [Improving error monitoring with AI](https://stackoverflow.blog/2025/03/18/improving-error-monitoring-with-ai/)

  * Featured on Meta 
  * [Community Asks Sprint Announcement - March 2025](https://meta.stackexchange.com/questions/407321/community-asks-sprint-announcement-march-2025)

  * [Experimenting with a new experiment opt-out option](https://meta.stackexchange.com/questions/407547/experimenting-with-a-new-experiment-opt-out-option)

  * [Stacks Editor development and testing](https://meta.stackoverflow.com/questions/433034/stacks-editor-development-and-testing)

  * [Policy: Generative AI (e.g., ChatGPT) is banned](https://meta.stackoverflow.com/questions/421831/policy-generative-ai-e-g-chatgpt-is-banned)

  * [Is it better to redirect users who attempt to perform actions they can't yet...](https://meta.stackoverflow.com/questions/432989/is-it-better-to-redirect-users-who-attempt-to-perform-actions-they-cant-yet-tak "Is it better to redirect users who attempt to perform actions they can't yet take?")




####  [ Hot Network Questions ](https://stackexchange.com/questions?tab=hot)

  * [ Show with a guy that has either super intelligence or computer chip in his brain ](https://scifi.stackexchange.com/questions/295505/show-with-a-guy-that-has-either-super-intelligence-or-computer-chip-in-his-brain)
  * [ Clustered Index Update operator performing excessive Logical Reads after query change ](https://dba.stackexchange.com/questions/345758/clustered-index-update-operator-performing-excessive-logical-reads-after-query-c)
  * [ Hidden Redstone Piston Door ](https://gaming.stackexchange.com/questions/411561/hidden-redstone-piston-door)
  * [ Is there a word for a shift in a road where it remains parallel to its original direction? ](https://english.stackexchange.com/questions/629981/is-there-a-word-for-a-shift-in-a-road-where-it-remains-parallel-to-its-original)
  * [ Fill in the missing numbers in the sequence ](https://puzzling.stackexchange.com/questions/131018/fill-in-the-missing-numbers-in-the-sequence)
  * [ Quiz game in C V1.0 ](https://codereview.stackexchange.com/questions/295672/quiz-game-in-c-v1-0)
  * [ Debugging a performance issue, do I commit the timing code? ](https://softwareengineering.stackexchange.com/questions/456868/debugging-a-performance-issue-do-i-commit-the-timing-code)
  * [ Teach me how to use directlua tonumber? ](https://tex.stackexchange.com/questions/739173/teach-me-how-to-use-directlua-tonumber)
  * [ Closed-source licensing of OS with Linux kernel ](https://opensource.stackexchange.com/questions/15414/closed-source-licensing-of-os-with-linux-kernel)
  * [ Why ever hammer a BB rather than turn to push it out? ](https://bicycles.stackexchange.com/questions/96384/why-ever-hammer-a-bb-rather-than-turn-to-push-it-out)
  * [ Trace distance under quantum gates and measurements ](https://quantumcomputing.stackexchange.com/questions/41464/trace-distance-under-quantum-gates-and-measurements)
  * [ Dataset links provided in the paper not working, authors not responding, next steps? ](https://academia.stackexchange.com/questions/217418/dataset-links-provided-in-the-paper-not-working-authors-not-responding-next-st)
  * [ How exactly did [arcade] Space Invaders get faster with fewer aliens? ](https://retrocomputing.stackexchange.com/questions/31423/how-exactly-did-arcade-space-invaders-get-faster-with-fewer-aliens)
  * [ Is it customary for financial offers to be in writing? ](https://academia.stackexchange.com/questions/217404/is-it-customary-for-financial-offers-to-be-in-writing)
  * [ How would humans need to adapt in order to survive in overgrown world? ](https://worldbuilding.stackexchange.com/questions/265367/how-would-humans-need-to-adapt-in-order-to-survive-in-overgrown-world)
  * [ CEO of startup is becoming more and more incoherent ](https://workplace.stackexchange.com/questions/200561/ceo-of-startup-is-becoming-more-and-more-incoherent)
  * [ Can I bring a guest to stay in a house I co-own without the consent of the other owner? ](https://law.stackexchange.com/questions/107819/can-i-bring-a-guest-to-stay-in-a-house-i-co-own-without-the-consent-of-the-other)
  * [ Do I ground IC pins marked "NC" in its datasheet? ](https://electronics.stackexchange.com/questions/741595/do-i-ground-ic-pins-marked-nc-in-its-datasheet)
  * [ What is the 'real-world' meaning of a mediation effect? ](https://stats.stackexchange.com/questions/662764/what-is-the-real-world-meaning-of-a-mediation-effect)
  * [ Is there a way to show a (6,3) Hamming code using Venn Diagrams? ](https://math.stackexchange.com/questions/5046931/is-there-a-way-to-show-a-6-3-hamming-code-using-venn-diagrams)
  * [ Universality all the way down? ](https://cs.stackexchange.com/questions/171513/universality-all-the-way-down)
  * [ Are "inland whales" in Oregon property of the governor, and other questions about "royal fish" ](https://law.stackexchange.com/questions/107831/are-inland-whales-in-oregon-property-of-the-governor-and-other-questions-abou)
  * [ Latex expl3 : assigning a value to a variable with tl_gset ](https://tex.stackexchange.com/questions/739190/latex-expl3-assigning-a-value-to-a-variable-with-tl-gset)
  * [ A pet in a city ](https://puzzling.stackexchange.com/questions/131008/a-pet-in-a-city)

more hot questions 

[ Question feed ](/feeds/question/79518187 "Feed of this question and its answers")

#  Subscribe to RSS 

Question feed 

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

![](/posts/79518187/ivc/76f2?prg=b85a8448-3070-4f43-85fe-409880479c26)

[](https://stackoverflow.com)

##### [Stack Overflow](https://stackoverflow.com)

  * [Questions](/questions)
  * [Help](/help)
  * [Chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)



##### [Products](https://stackoverflow.co/)

  * [Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=teams)
  * [Advertising](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=advertising)
  * [Talent](https://stackoverflow.co/advertising/employer-branding/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=talent)



##### [Company](https://stackoverflow.co/)

  * [About](https://stackoverflow.co/)
  * [Press](https://stackoverflow.co/company/press/)
  * [Work Here](https://stackoverflow.co/company/work-here/)
  * [Legal](https://stackoverflow.com/legal)
  * [Privacy Policy](https://stackoverflow.com/legal/privacy-policy)
  * [Terms of Service](https://stackoverflow.com/legal/terms-of-service/public)
  * [Contact Us](/contact)
  * Your Privacy Choices 
  * [Cookie Policy](https://stackoverflow.com/legal/cookie-policy)



##### [Stack Exchange Network](https://stackexchange.com)

  * [ Technology ](https://stackexchange.com/sites#technology)
  * [ Culture & recreation ](https://stackexchange.com/sites#culturerecreation)
  * [ Life & arts ](https://stackexchange.com/sites#lifearts)
  * [ Science ](https://stackexchange.com/sites#science)
  * [ Professional ](https://stackexchange.com/sites#professional)
  * [ Business ](https://stackexchange.com/sites#business)
  * [ API ](https://api.stackexchange.com/)
  * [ Data ](https://data.stackexchange.com/)



  * [Blog](https://stackoverflow.blog?blb=1)
  * [Facebook](https://www.facebook.com/officialstackoverflow/)
  * [Twitter](https://twitter.com/stackoverflow)
  * [LinkedIn](https://linkedin.com/company/stack-overflow)
  * [Instagram](https://www.instagram.com/thestackoverflow)



Site design / logo © 2025 Stack Exchange Inc;  user contributions licensed under  [CC BY-SA](https://stackoverflow.com/help/licensing) .  rev 2025.3.17.23948


scrape_date: 2025-03-18T12:03:06.375467
content_type: markdown
hash: 89c4b746cca07cded42cb9070097aa72aea7222e808d13d7b321a45dedf9e1d4
url:
https://stackoverflow.com/questions/79517873/annotating-grouped-blocks-of-identical-values-within-an-r-dataframe-without-a

title:
annotating grouped blocks of identical values within an R dataframe - without a for loop - Stack Overflow

content:
Skip to main content

[ Stack Overflow ](https://stackoverflow.com)

  1. [About](https://stackoverflow.co/)
  2. Products 
  3. [OverflowAI](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav-bar&utm_content=overflowai)



  1. [ Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers ](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-for-teams)
  2. [ Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand ](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-advertising)
  3. [ OverflowAI GenAI features for Teams ](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-ai)
  4. [ OverflowAPI Train & fine-tune LLMs ](https://stackoverflow.co/api-solutions/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-api)
  5. [ Labs The future of collective knowledge sharing ](https://stackoverflow.co/labs/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=labs)
  6. [About the company](https://stackoverflow.co/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=about-the-company) [Visit the blog](https://stackoverflow.blog/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=blog)



Loading…

  1. ###  [current community](https://stackoverflow.com)

     * [ Stack Overflow  ](https://stackoverflow.com)

[help](https://stackoverflow.com/help) [chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)

     * [ Meta Stack Overflow  ](https://meta.stackoverflow.com)

###  your communities 

[Sign up](https://stackoverflow.com/users/signup?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79517873%2fannotating-grouped-blocks-of-identical-values-within-an-r-dataframe-without-a) or [log in](https://stackoverflow.com/users/login?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79517873%2fannotating-grouped-blocks-of-identical-values-within-an-r-dataframe-without-a) to customize your list. 

### [more stack exchange communities](https://stackexchange.com/sites)

[company blog](https://stackoverflow.blog)

  2.   3. [Log in](https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79517873%2fannotating-grouped-blocks-of-identical-values-within-an-r-dataframe-without-a)
  4. [Sign up](https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79517873%2fannotating-grouped-blocks-of-identical-values-within-an-r-dataframe-without-a)



  1.     1. [ Home ](/)
    2. [ Questions ](/questions)
    3. [ Tags ](/tags)
    4.     5. [ Users ](/users)
    6. [ Companies ](https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav)
    7. [ Labs ](javascript:void\(0\))
    8. [ Jobs ](/jobs?source=so-left-nav)
    9. [ Discussions ](/beta/discussions)
    10. [ Collectives ](javascript:void\(0\))

    11. Communities for your favorite technologies. [Explore all Collectives](/collectives-all)

  2. Teams

![](https://cdn.sstatic.net/Img/teams/teams-promo.svg?v=e507948b81bf)

Ask questions, find answers and collaborate at work with Stack Overflow for Teams. 

[Try Teams for free](https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams)

  3. [ Teams ](javascript:void\(0\))
  4. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact)




##### Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

[ Learn more about Collectives ](/collectives)

**Teams**

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

[ Learn more about Teams ](https://stackoverflow.co/teams/)

Get early access and see previews of new features.

[ Learn more about Labs](https://stackoverflow.co/labs/)

# [annotating grouped blocks of identical values within an R dataframe - without a for loop [duplicate]](/questions/79517873/annotating-grouped-blocks-of-identical-values-within-an-r-dataframe-without-a)

[ Ask Question ](/questions/ask)

Asked today

Modified [today](?lastactivity "2025-03-18 17:02:32Z")

Viewed 34 times 

Part of [R Language](/collectives/r-language) Collective 

1 

[](/posts/79517873/timeline "Show activity on this post.")

**This question already has answers here** : 

[How to create a consecutive group number](/questions/6112803/how-to-create-a-consecutive-group-number) (13 answers) 

[Create group number for contiguous runs of equal values](/questions/30314679/create-group-number-for-contiguous-runs-of-equal-values) (5 answers) 

Closed 1 hour ago.

I have some data to plot, which for purposes of organization and annotation are broken into several blocks, defined by a combination of variables including the one I'm calling `group` in my code. The idea is that I want to differently plot the first batch of group "A" from the second batch of "A", same with "B" and "C," etc. So I want to mark each batch with a unique identifier, which here I'm calling `plot_group`. To do this, I'd like to march along the length of `group`, and increment `plot_group` by 1 every time I move from one group to another.

I've figured out how to do this with a `for` loop, below, but it looks ugly and I'd rather be able to do it with a vectorized function. I can't for the life of me figure out how, though, even using things like `seq_along` and `lag`, and the problem seems to be that a function can't refer to its own output on the fly.

There must be a dumb and obvious thing I'm missing, since this is hardly a sophisticated problem. Does anyone have a recommendation?
    
    
    # vector of groups - repeated twice
    group <- c(rep(c(rep('A', 2), rep('B', 4), rep('C', 3)),2))
    
    # run through the "group" variable, incrementing plot_group by one every time a new group is encountered
    for (i in seq_along(group)) {
      # if we are at the beginning, initiate the first group as "1"
      if(i==1) plot_group <- 1
      # otherwise, check if we are at a new group - if so, increment plot_group by 1
      else {
        if (group[i] != group[i-1]) plot_group <- c(plot_group, plot_group[i-1]+1)
        # if not, then just return the current plot_group variable
        else plot_group <- c(plot_group, plot_group[i-1])
      }
    }
    
    tibble(group=group, plot_group=plot_group)
    
    # returns what I want:
    ## A tibble: 18 × 2
    # group plot_group
    # <chr>      <dbl>
    # 1 A               1
    # 2 A               1
    # 3 B               2
    # 4 B               2
    # 5 B               2
    # 6 B               2
    # 7 C               3
    # 8 C               3
    # 9 C               3
    # 10 A              4
    # 11 A              4
    # 12 B              5
    # 13 B              5
    # 14 B              5
    # 15 B              5
    # 16 C              6
    # 17 C              6
    # 18 C              6
    
    rm(plot_group)
    
    # do the same as the above, but with sapply
    plot_group <- sapply(seq_along(group), function(i) {
      if(i==1) return(1)
      else {
        if (group[i] != group[i-1]) return(plot_group[i-1] + 1)
        else return(plot_group[i-1])
      }
    })
    # returns "Error in FUN(X[[i]], ...) : object 'plot_group' not found"
    

[](/collectives/r-language "R Language Collective")

  * [r](/questions/tagged/r "show questions tagged 'r'")
  * [for-loop](/questions/tagged/for-loop "show questions tagged 'for-loop'")
  * [dplyr](/questions/tagged/dplyr "show questions tagged 'dplyr'")



[Share](/q/79517873 "Short permalink to this question")

[Improve this question](/posts/79517873/edit)

Follow 

asked 2 hours ago

[![C. Murtaugh's user avatar](https://www.gravatar.com/avatar/ebca9347bbd2571a7cca7d1e3cf90d53?s=64&d=identicon&r=PG&f=y&so-version=2)](/users/5434275/c-murtaugh)

[C. Murtaugh](/users/5434275/c-murtaugh)C. Murtaugh

67555 silver badges1515 bronze badges

5

  * I did look for similar questions before I posted, and in fact although I didn't find that one, the accepted solution won't work for me. If I call `as.numeric(as.factor(group))`, it will assume that the second batch of "A" is the same as the first batch, which is exactly what I'm trying to avoid.

- [C. Murtaugh](/users/5434275/c-murtaugh "675 reputation")

Commented 1 hour ago

  * `with(rle(group), rep(seq_along(values), lengths))` is not what you want?

- [Friede](/users/20002111/friede "8,443 reputation")

Commented 1 hour ago

  * Yes, that works perfectly, thank you. Note that although this is present among the answers to the linked question, it's pretty far down and it isn't the accepted answer. If you want to post that as an answer to this question, I'll accept and close.

- [C. Murtaugh](/users/5434275/c-murtaugh "675 reputation")

Commented 1 hour ago

  * 1

Maybe you haven't realized this over the years, but on Stack Overflow, the accepted answer is often not the best/desired one. You could upvote [@Jaap's answer](https://stackoverflow.com/a/39707059/6574038), though, to make it more visible ;)

- [jay.sf](/users/6574038/jay-sf "73,852 reputation")

Commented 56 mins ago

  * @jay.sf I think this may be a better target: [Create group number for contiguous runs of equal values](https://stackoverflow.com/questions/30314679/create-group-number-for-contiguous-runs-of-equal-values)

- [Gusbourne](/users/27078793/gusbourne "98 reputation")

Commented 13 mins ago




Add a comment  | 

##  2 Answers 2

Sorted by:  [ Reset to default ](/questions/79517873/annotating-grouped-blocks-of-identical-values-within-an-r-dataframe-without-a?answertab=scoredesc#tab-top)

Highest score (default)  Trending (recent votes count more)  Date modified (newest first)  Date created (oldest first) 

1 

[](/posts/79518036/timeline "Show activity on this post.")

Using `base::rle`:
    
    
    group <- c(rep(c(rep('A', 2), rep('B', 4), rep('C', 3)),2))
    
    data.frame(group, 
               plot_group = rle(group)$length |> 
                 (\(.x) rep(seq_along(.x), .x))())
    
    #>    group plot_group
    #> 1      A          1
    #> 2      A          1
    #> 3      B          2
    #> 4      B          2
    #> 5      B          2
    #> 6      B          2
    #> 7      C          3
    #> 8      C          3
    #> 9      C          3
    #> 10     A          4
    #> 11     A          4
    #> 12     B          5
    #> 13     B          5
    #> 14     B          5
    #> 15     B          5
    #> 16     C          6
    #> 17     C          6
    #> 18     C          6
    

or in `dplyr`:
    
    
    tibble(group) %>% 
      mutate(consecutive_id(group))
    

Created on 2025-03-18 with [reprex v2.1.1](https://reprex.tidyverse.org)

[Share](/a/79518036 "Short permalink to this answer")

[Improve this answer](/posts/79518036/edit)

Follow 

answered 1 hour ago

[![M--'s user avatar](https://i.sstatic.net/BlsdV.jpg?s=64)](/users/6461462/m)

[M--](/users/6461462/m)M--

29.3k1010 gold badges6969 silver badges106106 bronze badges

[ Recognized by R Language Collective](/collectives/r-language)




Add a comment  | 

1 

[](/posts/79517915/timeline "Show activity on this post.")

You could make a variable for when the groups change that is 1 if `group` is different from `lag(group)` and then take the cumulative sum of that variable. Add 1 if you want the groups to start at 1 instead of 0.
    
    
    library(dplyr)
    group <- c(rep(c(rep('A', 2), rep('B', 4), rep('C', 3)),2))
    dat <- data.frame(group = group) 
    dat <- dat %>% 
      mutate(change = case_when(group != lag(group) ~ 1, 
                                TRUE ~ 0), 
             plot_group = 1+ cumsum(change))
    dat
    #>    group change plot_group
    #> 1      A      0          1
    #> 2      A      0          1
    #> 3      B      1          2
    #> 4      B      0          2
    #> 5      B      0          2
    #> 6      B      0          2
    #> 7      C      1          3
    #> 8      C      0          3
    #> 9      C      0          3
    #> 10     A      1          4
    #> 11     A      0          4
    #> 12     B      1          5
    #> 13     B      0          5
    #> 14     B      0          5
    #> 15     B      0          5
    #> 16     C      1          6
    #> 17     C      0          6
    #> 18     C      0          6
    

Or as a one-liner:
    
    
    dat <- data.frame(group = group) 
    dat$plot_group <- cumsum(case_when(dat$group != lag(dat$group) ~ 1,TRUE ~ 0)) + 1
    dat
    #>    group plot_group
    #> 1      A          1
    #> 2      A          1
    #> 3      B          2
    #> 4      B          2
    #> 5      B          2
    #> 6      B          2
    #> 7      C          3
    #> 8      C          3
    #> 9      C          3
    #> 10     A          4
    #> 11     A          4
    #> 12     B          5
    #> 13     B          5
    #> 14     B          5
    #> 15     B          5
    #> 16     C          6
    #> 17     C          6
    #> 18     C          6
    

Created on 2025-03-18 with [reprex v2.1.1.9000](https://reprex.tidyverse.org)

[Share](/a/79517915 "Short permalink to this answer")

[Improve this answer](/posts/79517915/edit)

Follow 

answered 1 hour ago

[![DaveArmstrong's user avatar](https://i.sstatic.net/auWep.jpg?s=64)](/users/8206434/davearmstrong)

[DaveArmstrong](/users/8206434/davearmstrong)DaveArmstrong

22.1k22 gold badges1515 silver badges2929 bronze badges

1

  * 2

Isn't this just consecutive id, i.e. `with(rle(group), rep(seq_along(values), lengths))`?

- [Friede](/users/20002111/friede "8,443 reputation")

Commented 1 hour ago




Add a comment  | 

Start asking to get answers

Find the answer to your question by asking.

[Ask question](/questions/ask)

Explore related questions

  * [r](/questions/tagged/r "show questions tagged 'r'")
  * [for-loop](/questions/tagged/for-loop "show questions tagged 'for-loop'")
  * [dplyr](/questions/tagged/dplyr "show questions tagged 'dplyr'")



See similar questions with these tags.

[ R Language Collective Join the discussion ](/collectives/r-language/beta/discussions)

[ This question is in a collective:](/collectives) a subcommunity defined by tags with relevant content and experts. 

  * The Overflow Blog 
  * [To get ahead with AI, fine-tune your data strategy](https://stackoverflow.blog/2025/03/17/to-get-ahead-with-ai-fine-tune-your-data-strategy/)

  * [Improving error monitoring with AI](https://stackoverflow.blog/2025/03/18/improving-error-monitoring-with-ai/)

  * Featured on Meta 
  * [Community Asks Sprint Announcement - March 2025](https://meta.stackexchange.com/questions/407321/community-asks-sprint-announcement-march-2025)

  * [Experimenting with a new experiment opt-out option](https://meta.stackexchange.com/questions/407547/experimenting-with-a-new-experiment-opt-out-option)

  * [Stacks Editor development and testing](https://meta.stackoverflow.com/questions/433034/stacks-editor-development-and-testing)

  * [Policy: Generative AI (e.g., ChatGPT) is banned](https://meta.stackoverflow.com/questions/421831/policy-generative-ai-e-g-chatgpt-is-banned)

  * [Is it better to redirect users who attempt to perform actions they can't yet...](https://meta.stackoverflow.com/questions/432989/is-it-better-to-redirect-users-who-attempt-to-perform-actions-they-cant-yet-tak "Is it better to redirect users who attempt to perform actions they can't yet take?")




#### Linked

[ 54 ](/q/6112803 "Question score \(upvotes - downvotes\)") [How to create a consecutive group number](/questions/6112803/how-to-create-a-consecutive-group-number?noredirect=1)

[ 14 ](/q/30314679 "Question score \(upvotes - downvotes\)") [Create group number for contiguous runs of equal values](/questions/30314679/create-group-number-for-contiguous-runs-of-equal-values?noredirect=1)

#### Related

[ 916 ](/q/21435339 "Question score \(upvotes - downvotes\)") [data.table vs dplyr: can one do something well the other can't or does poorly?](/questions/21435339/data-table-vs-dplyr-can-one-do-something-well-the-other-cant-or-does-poorly)

[ 1 ](/q/72654671 "Question score \(upvotes - downvotes\)") [Add a column with single value per group](/questions/72654671/add-a-column-with-single-value-per-group)

[ 1 ](/q/73093280 "Question score \(upvotes - downvotes\)") [modular filter and mutate based on user input R](/questions/73093280/modular-filter-and-mutate-based-on-user-input-r)

[ 0 ](/q/77357659 "Question score \(upvotes - downvotes\)") [R inner join based on partial matching between 2 string vectors](/questions/77357659/r-inner-join-based-on-partial-matching-between-2-string-vectors)

[ 0 ](/q/51270111 "Question score \(upvotes - downvotes\)") [Updating a vector outside a For Loop based on dataframe column condition](/questions/51270111/updating-a-vector-outside-a-for-loop-based-on-dataframe-column-condition)

[ 0 ](/q/23911994 "Question score \(upvotes - downvotes\)") [Avoid for-loop: Define blocks of actions within a time range](/questions/23911994/avoid-for-loop-define-blocks-of-actions-within-a-time-range)

[ 1 ](/q/71580363 "Question score \(upvotes - downvotes\)") [R as_tsibble() running out of memory](/questions/71580363/r-as-tsibble-running-out-of-memory)

[ 2 ](/q/77653740 "Question score \(upvotes - downvotes\)") ["Case_when" depending on the index of an element in R?](/questions/77653740/case-when-depending-on-the-index-of-an-element-in-r)

[ 2 ](/q/59269319 "Question score \(upvotes - downvotes\)") [How to extract list elements into multiple tibble columns in r?](/questions/59269319/how-to-extract-list-elements-into-multiple-tibble-columns-in-r)

[ 1 ](/q/59360082 "Question score \(upvotes - downvotes\)") [How to flatten results of function call as part of dplyr::mutate?](/questions/59360082/how-to-flatten-results-of-function-call-as-part-of-dplyrmutate)

####  [ Hot Network Questions ](https://stackexchange.com/questions?tab=hot)

  * [ Equivalent English for a Gujarati saying paraphrased as "Goldsmithing proved costlier than the gold" ](https://english.stackexchange.com/questions/630087/equivalent-english-for-a-gujarati-saying-paraphrased-as-goldsmithing-proved-cos)
  * [ Does this phrase makes sense: "hanc ego viam si asperam atque duram negem, mentiar" ](https://latin.stackexchange.com/questions/24532/does-this-phrase-makes-sense-hanc-ego-viam-si-asperam-atque-duram-negem-menti)
  * [ Interpretation of null hypothesis for t-test on rank-transformed data ](https://stats.stackexchange.com/questions/662751/interpretation-of-null-hypothesis-for-t-test-on-rank-transformed-data)
  * [ What does "Fine for the Beaver, but not exactly tycoon territory" mean? ](https://movies.stackexchange.com/questions/124872/what-does-fine-for-the-beaver-but-not-exactly-tycoon-territory-mean)
  * [ Is there a way to show a (6,3) Hamming code using Venn Diagrams? ](https://math.stackexchange.com/questions/5046931/is-there-a-way-to-show-a-6-3-hamming-code-using-venn-diagrams)
  * [ Is there a word for a shift in a road where it remains parallel to its original direction? ](https://english.stackexchange.com/questions/629981/is-there-a-word-for-a-shift-in-a-road-where-it-remains-parallel-to-its-original)
  * [ Entering USA as an Iranian Born naturalized British Citizen ](https://travel.stackexchange.com/questions/193780/entering-usa-as-an-iranian-born-naturalized-british-citizen)
  * [ Is this an acceptable workaround to mounting a rear cargo rack around the rear brake? ](https://bicycles.stackexchange.com/questions/96386/is-this-an-acceptable-workaround-to-mounting-a-rear-cargo-rack-around-the-rear-b)
  * [ Is having over 1 mil edges a bad thing? ](https://blender.stackexchange.com/questions/332443/is-having-over-1-mil-edges-a-bad-thing)
  * [ Clustered Index Update operator performing excessive Logical Reads after query change ](https://dba.stackexchange.com/questions/345758/clustered-index-update-operator-performing-excessive-logical-reads-after-query-c)
  * [ Can I use the same wooden cutting board for vegetables and meat if I cut the vegetables first? ](https://cooking.stackexchange.com/questions/130354/can-i-use-the-same-wooden-cutting-board-for-vegetables-and-meat-if-i-cut-the-veg)
  * [ Material used for pannier backing ](https://bicycles.stackexchange.com/questions/96388/material-used-for-pannier-backing)
  * [ How to perform a simple DIY test for secure electronics enclosure during transport? ](https://electronics.stackexchange.com/questions/741664/how-to-perform-a-simple-diy-test-for-secure-electronics-enclosure-during-transpo)
  * [ Adverb over: clothes ](https://ell.stackexchange.com/questions/363292/adverb-over-clothes)
  * [ Continue the /sequence\ ](https://puzzling.stackexchange.com/questions/131015/continue-the-sequence)
  * [ In Hebrews 2:11, how can sons of God be brothers of God, if God is our Father and we are his sons? ](https://hermeneutics.stackexchange.com/questions/102386/in-hebrews-211-how-can-sons-of-god-be-brothers-of-god-if-god-is-our-father-an)
  * [ What does tying up the strongman mean in Matthew 12? ](https://hermeneutics.stackexchange.com/questions/102376/what-does-tying-up-the-strongman-mean-in-matthew-12)
  * [ Can we still use the word "tweet" now that Twitter has been rebranded as X? ](https://ell.stackexchange.com/questions/363209/can-we-still-use-the-word-tweet-now-that-twitter-has-been-rebranded-as-x)
  * [ How to make the weather matter? ](https://rpg.stackexchange.com/questions/214997/how-to-make-the-weather-matter)
  * [ Don't Be a Square: Polygons on the Square Lattice ](https://puzzling.stackexchange.com/questions/130991/dont-be-a-square-polygons-on-the-square-lattice)
  * [ Unless in conditional sentences ](https://ell.stackexchange.com/questions/363259/unless-in-conditional-sentences)
  * [ What are the differences in Artscroll editions of Chumash and Tanakh? ](https://judaism.stackexchange.com/questions/148304/what-are-the-differences-in-artscroll-editions-of-chumash-and-tanakh)
  * [ Distributing a library under a license different than its examples ](https://opensource.stackexchange.com/questions/15411/distributing-a-library-under-a-license-different-than-its-examples)
  * [ Why does the "花" for "flower" and "spending money" uses the same character? ](https://chinese.stackexchange.com/questions/59928/why-does-the-%e8%8a%b1-for-flower-and-spending-money-uses-the-same-character)

more hot questions 

![](/posts/79517873/ivc/76f2?prg=32cb3859-5aec-4cac-b7a2-2f5e971f91cf)

lang-r

![](/js-false.gif)

[](https://stackoverflow.com)

##### [Stack Overflow](https://stackoverflow.com)

  * [Questions](/questions)
  * [Help](/help)
  * [Chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)



##### [Products](https://stackoverflow.co/)

  * [Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=teams)
  * [Advertising](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=advertising)
  * [Talent](https://stackoverflow.co/advertising/employer-branding/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=talent)



##### [Company](https://stackoverflow.co/)

  * [About](https://stackoverflow.co/)
  * [Press](https://stackoverflow.co/company/press/)
  * [Work Here](https://stackoverflow.co/company/work-here/)
  * [Legal](https://stackoverflow.com/legal)
  * [Privacy Policy](https://stackoverflow.com/legal/privacy-policy)
  * [Terms of Service](https://stackoverflow.com/legal/terms-of-service/public)
  * [Contact Us](/contact)
  * Your Privacy Choices 
  * [Cookie Policy](https://stackoverflow.com/legal/cookie-policy)



##### [Stack Exchange Network](https://stackexchange.com)

  * [ Technology ](https://stackexchange.com/sites#technology)
  * [ Culture & recreation ](https://stackexchange.com/sites#culturerecreation)
  * [ Life & arts ](https://stackexchange.com/sites#lifearts)
  * [ Science ](https://stackexchange.com/sites#science)
  * [ Professional ](https://stackexchange.com/sites#professional)
  * [ Business ](https://stackexchange.com/sites#business)
  * [ API ](https://api.stackexchange.com/)
  * [ Data ](https://data.stackexchange.com/)



  * [Blog](https://stackoverflow.blog?blb=1)
  * [Facebook](https://www.facebook.com/officialstackoverflow/)
  * [Twitter](https://twitter.com/stackoverflow)
  * [LinkedIn](https://linkedin.com/company/stack-overflow)
  * [Instagram](https://www.instagram.com/thestackoverflow)



Site design / logo © 2025 Stack Exchange Inc;  user contributions licensed under  [CC BY-SA](https://stackoverflow.com/help/licensing) .  rev 2025.3.17.23948


url: https://stackoverflow.com/questions/20060500/how-best-to-store-an-array-in-oracle
title: How best to store an array in Oracle? - Stack Overflow
scrape_date: 2025-03-18T12:03:06.375474
content_type: markdown
hash: 4172114ad6f06661d1de57d0585ccc513d4d37f4dda6019af46ea352bd2158a1
content:
Skip to main content

[ Stack Overflow ](https://stackoverflow.com)

  1. [About](https://stackoverflow.co/)
  2. Products 
  3. [OverflowAI](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav-bar&utm_content=overflowai)



  1. [ Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers ](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-for-teams)
  2. [ Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand ](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-advertising)
  3. [ OverflowAI GenAI features for Teams ](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-ai)
  4. [ OverflowAPI Train & fine-tune LLMs ](https://stackoverflow.co/api-solutions/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-api)
  5. [ Labs The future of collective knowledge sharing ](https://stackoverflow.co/labs/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=labs)
  6. [About the company](https://stackoverflow.co/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=about-the-company) [Visit the blog](https://stackoverflow.blog/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=blog)



Loading…

  1. ###  [current community](https://stackoverflow.com)

     * [ Stack Overflow  ](https://stackoverflow.com)

[help](https://stackoverflow.com/help) [chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)

     * [ Meta Stack Overflow  ](https://meta.stackoverflow.com)

###  your communities 

[Sign up](https://stackoverflow.com/users/signup?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f20060500%2fhow-best-to-store-an-array-in-oracle) or [log in](https://stackoverflow.com/users/login?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f20060500%2fhow-best-to-store-an-array-in-oracle) to customize your list. 

### [more stack exchange communities](https://stackexchange.com/sites)

[company blog](https://stackoverflow.blog)

  2.   3. [Log in](https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f20060500%2fhow-best-to-store-an-array-in-oracle)
  4. [Sign up](https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f20060500%2fhow-best-to-store-an-array-in-oracle)



  1.     1. [ Home ](/)
    2. [ Questions ](/questions)
    3. [ Tags ](/tags)
    4.     5. [ Users ](/users)
    6. [ Companies ](https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav)
    7. [ Labs ](javascript:void\(0\))
    8. [ Jobs ](/jobs?source=so-left-nav)
    9. [ Discussions ](/beta/discussions)
    10. [ Collectives ](javascript:void\(0\))

    11. Communities for your favorite technologies. [Explore all Collectives](/collectives-all)

  2. Teams

![](https://cdn.sstatic.net/Img/teams/teams-promo.svg?v=e507948b81bf)

Ask questions, find answers and collaborate at work with Stack Overflow for Teams. 

[Try Teams for free](https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams)

  3. [ Teams ](javascript:void\(0\))
  4. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact)




##### Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

[ Learn more about Collectives ](/collectives)

**Teams**

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

[ Learn more about Teams ](https://stackoverflow.co/teams/)

Get early access and see previews of new features.

[ Learn more about Labs](https://stackoverflow.co/labs/)

# [How best to store an array in Oracle?](/questions/20060500/how-best-to-store-an-array-in-oracle)

[ Ask Question ](/questions/ask)

Asked 11 years, 4 months ago

Modified [today](?lastactivity "2025-03-18 17:00:40Z")

Viewed 10k times 

3 

[](/posts/20060500/timeline "Show activity on this post.")

I plan to create an Oracle database that will contain arrays of numeric data. Each array has from 2 to 4 dimensions, and on the order of 1000 data points. I will want to use the arrays in WHERE clauses, e.g. .

Oracle's array support (VARRAYS, Nested Tables) seems disappointing; it's awfully hard for client software to retrieve the data in a useful way. Possible, but hard.

Any advice is appreciated.

  * [arrays](/questions/tagged/arrays "show questions tagged 'arrays'")
  * [oracle-database](/questions/tagged/oracle-database "show questions tagged 'oracle-database'")
  * [nested](/questions/tagged/nested "show questions tagged 'nested'")
  * [varray](/questions/tagged/varray "show questions tagged 'varray'")



[Share](/q/20060500 "Short permalink to this question")

[Improve this question](/posts/20060500/edit)

Follow 

asked Nov 18, 2013 at 23:59

[![user3006778's user avatar](https://www.gravatar.com/avatar/dd355c7b6690d6bd0f0bad2ef9483ad1?s=64&d=identicon&r=PG&f=y&so-version=2)](/users/3006778/user3006778)

[user3006778](/users/3006778/user3006778)user3006778

4111 gold badge11 silver badge44 bronze badges

5

  * 5

What's wrong with a good old, regular table?

- [OldProgrammer](/users/1745544/oldprogrammer "12,179 reputation")

Commented Nov 19, 2013 at 0:08

  * > What's wrong with a good old, regular table? You mean like a table with columns X11, X12, X13, X21, X22, etc? These arrays are ~ 10 x 10 x 10. Not very practical to represent each item as a column.

- [user3006778](/users/3006778/user3006778 "41 reputation")

Commented Nov 19, 2013 at 3:50

  * you might want to have a look at oracle spatial and how they solved similar problems.

- [steve](/users/121035/steve "6,020 reputation")

Commented Nov 19, 2013 at 4:12

  * 2

An array is an organising principle and is not required in a relational database. Instead, think of each data point as a "fact" and then store each fact as a tuple. e.g. table DATAPOINTS with columns DIMENSION1, DIMENSION2, DIMENSION3, DIMENSION4, POINTVALUE. If the ordering of the values within an "array" is important, add an ORDERINDEX column. With this design you'll have the best flexibility, and the full power of SQL analytics will be at your disposal.

- [Jeffrey Kemp](/users/103295/jeffrey-kemp "60,312 reputation")

Commented Nov 19, 2013 at 5:13

  * Jeffrey, interesting idea. I will give this a try.

- [user3006778](/users/3006778/user3006778 "41 reputation")

Commented Nov 19, 2013 at 6:46




Add a comment  | 

##  1 Answer 1

Sorted by:  [ Reset to default ](/questions/20060500/how-best-to-store-an-array-in-oracle?answertab=scoredesc#tab-top)

Highest score (default)  Trending (recent votes count more)  Date modified (newest first)  Date created (oldest first) 

0 

[](/posts/20063108/timeline "Show activity on this post.")

Simple example of varray
    
    
    declare
       type array_example is varray(5) of varchar2(1);
       array array_example := array_example('A', 'B', 'C' , 'D', 'E');
    begin
       for i in 1..array.count loop
           dbms_output.put_line(array(i));
       end loop;
    end;
    

[Share](/a/20063108 "Short permalink to this answer")

[Improve this answer](/posts/20063108/edit)

Follow 

answered Nov 19, 2013 at 4:16

[![Pravin Satav's user avatar](https://www.gravatar.com/avatar/3d7cab391330f731d1e0da1bc9d6e5df?s=64&d=identicon&r=PG)](/users/167110/pravin-satav)

[Pravin Satav](/users/167110/pravin-satav)Pravin Satav

70255 gold badges1818 silver badges3737 bronze badges

1

  * 1

Pravin, I have found that VARRAYs are great if you stay within Oracle and PL/SQL. But they make it hard to retrieve the data for manipulation outside of Oracle.

- [user3006778](/users/3006778/user3006778 "41 reputation")

Commented Nov 19, 2013 at 6:45




Add a comment  | 

##  Your Answer 

Thanks for contributing an answer to Stack Overflow!

  * Please be sure to _answer the question_. Provide details and share your research!



But _avoid_ …

  * Asking for help, clarification, or responding to other answers.
  * Making statements based on opinion; back them up with references or personal experience.



To learn more, see our [tips on writing great answers](/help/how-to-answer).

Draft saved

Draft discarded

### Sign up or [log in](/users/login?ssrc=question_page&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f20060500%2fhow-best-to-store-an-array-in-oracle%23new-answer)

Sign up using Google 

Sign up using Email and Password 

Submit

### Post as a guest

Name

Email

Required, but never shown

### Post as a guest

Name

Email

Required, but never shown

Post Your Answer  Discard 

By clicking “Post Your Answer”, you agree to our [terms of service](https://stackoverflow.com/legal/terms-of-service/public) and acknowledge you have read our [privacy policy](https://stackoverflow.com/legal/privacy-policy).

Start asking to get answers

Find the answer to your question by asking.

[Ask question](/questions/ask)

Explore related questions

  * [arrays](/questions/tagged/arrays "show questions tagged 'arrays'")
  * [oracle-database](/questions/tagged/oracle-database "show questions tagged 'oracle-database'")
  * [nested](/questions/tagged/nested "show questions tagged 'nested'")
  * [varray](/questions/tagged/varray "show questions tagged 'varray'")



See similar questions with these tags.

  * The Overflow Blog 
  * [To get ahead with AI, fine-tune your data strategy](https://stackoverflow.blog/2025/03/17/to-get-ahead-with-ai-fine-tune-your-data-strategy/)

  * [Improving error monitoring with AI](https://stackoverflow.blog/2025/03/18/improving-error-monitoring-with-ai/)

  * Featured on Meta 
  * [Community Asks Sprint Announcement - March 2025](https://meta.stackexchange.com/questions/407321/community-asks-sprint-announcement-march-2025)

  * [Experimenting with a new experiment opt-out option](https://meta.stackexchange.com/questions/407547/experimenting-with-a-new-experiment-opt-out-option)

  * [Stacks Editor development and testing](https://meta.stackoverflow.com/questions/433034/stacks-editor-development-and-testing)

  * [Policy: Generative AI (e.g., ChatGPT) is banned](https://meta.stackoverflow.com/questions/421831/policy-generative-ai-e-g-chatgpt-is-banned)

  * [Is it better to redirect users who attempt to perform actions they can't yet...](https://meta.stackoverflow.com/questions/432989/is-it-better-to-redirect-users-who-attempt-to-perform-actions-they-cant-yet-tak "Is it better to redirect users who attempt to perform actions they can't yet take?")




#### Related

[ 2 ](/q/1401801 "Question score \(upvotes - downvotes\)") [Arrays in Oracle SQL](/questions/1401801/arrays-in-oracle-sql)

[ 5 ](/q/1826209 "Question score \(upvotes - downvotes\)") [How to deal with VARRAYs (Oracle 9i) in JDBC?](/questions/1826209/how-to-deal-with-varrays-oracle-9i-in-jdbc)

[ 14 ](/q/3545379 "Question score \(upvotes - downvotes\)") [oracle pl/sql arrays](/questions/3545379/oracle-pl-sql-arrays)

[ 2 ](/q/5514276 "Question score \(upvotes - downvotes\)") [Arrays in Oracle PL/SQL to store rows](/questions/5514276/arrays-in-oracle-pl-sql-to-store-rows)

[ 8 ](/q/21339796 "Question score \(upvotes - downvotes\)") [Oracle - How to read from VARRAY](/questions/21339796/oracle-how-to-read-from-varray)

[ 5 ](/q/29787961 "Question score \(upvotes - downvotes\)") [Difference between NESTED TABLE and VARRAY](/questions/29787961/difference-between-nested-table-and-varray)

[ 2 ](/q/41162978 "Question score \(upvotes - downvotes\)") [Create and populate Varray in Oracle SQL](/questions/41162978/create-and-populate-varray-in-oracle-sql)

[ 0 ](/q/41460543 "Question score \(upvotes - downvotes\)") [Query to store multiple data in an array in 1 row](/questions/41460543/query-to-store-multiple-data-in-an-array-in-1-row)

[ 0 ](/q/43803145 "Question score \(upvotes - downvotes\)") [Store Varray [PL/SQL]](/questions/43803145/store-varray-pl-sql)

[ 2 ](/q/52327518 "Question score \(upvotes - downvotes\)") [Oracle Apex - Save list of numbers in a varray-table-field](/questions/52327518/oracle-apex-save-list-of-numbers-in-a-varray-table-field)

####  [ Hot Network Questions ](https://stackexchange.com/questions?tab=hot)

  * [ Are oxalate and thioxalate ions ambidentate ligands? ](https://chemistry.stackexchange.com/questions/187981/are-oxalate-and-thioxalate-ions-ambidentate-ligands)
  * [ What are these pom pom trees? ](https://gardening.stackexchange.com/questions/67799/what-are-these-pom-pom-trees)
  * [ What is a 'Phlegm dealership'? ](https://movies.stackexchange.com/questions/124871/what-is-a-phlegm-dealership)
  * [ Material used for pannier backing ](https://bicycles.stackexchange.com/questions/96388/material-used-for-pannier-backing)
  * [ Don't Be a Square: Polygons on the Square Lattice ](https://puzzling.stackexchange.com/questions/130991/dont-be-a-square-polygons-on-the-square-lattice)
  * [ Best weapon for humans to ambush sapient elephants? ](https://worldbuilding.stackexchange.com/questions/265378/best-weapon-for-humans-to-ambush-sapient-elephants)
  * [ Is it common now that Thailand immigration asks for proof of onward travel? ](https://travel.stackexchange.com/questions/193788/is-it-common-now-that-thailand-immigration-asks-for-proof-of-onward-travel)
  * [ Teach me how to use directlua tonumber? ](https://tex.stackexchange.com/questions/739173/teach-me-how-to-use-directlua-tonumber)
  * [ What happens if Flixbus doesn't assign a seat on the ticket? ](https://travel.stackexchange.com/questions/193776/what-happens-if-flixbus-doesnt-assign-a-seat-on-the-ticket)
  * [ Continue the /sequence\ ](https://puzzling.stackexchange.com/questions/131015/continue-the-sequence)
  * [ Looking for a quote to the effect of "Heaven is slightly frustrating" ](https://literature.stackexchange.com/questions/28965/looking-for-a-quote-to-the-effect-of-heaven-is-slightly-frustrating)
  * [ A surprisingly difficult fact about bilinear maps ](https://math.stackexchange.com/questions/5046798/a-surprisingly-difficult-fact-about-bilinear-maps)
  * [ Do pentesters need to be able to fix their findings for their customers? ](https://security.stackexchange.com/questions/280837/do-pentesters-need-to-be-able-to-fix-their-findings-for-their-customers)
  * [ Can I switch from Sales to Data Science/Analysis with no degree in a year? ](https://datascience.stackexchange.com/questions/131582/can-i-switch-from-sales-to-data-science-analysis-with-no-degree-in-a-year)
  * [ What are the differences in Artscroll editions of Chumash and Tanakh? ](https://judaism.stackexchange.com/questions/148304/what-are-the-differences-in-artscroll-editions-of-chumash-and-tanakh)
  * [ Can I bring a guest to stay in a house I co-own without the consent of the other owner? ](https://law.stackexchange.com/questions/107819/can-i-bring-a-guest-to-stay-in-a-house-i-co-own-without-the-consent-of-the-other)
  * [ Can you connect two adjustable duct elbows together? ](https://diy.stackexchange.com/questions/315938/can-you-connect-two-adjustable-duct-elbows-together)
  * [ Tips for golfing in ☾ (Moon) ](https://codegolf.stackexchange.com/questions/278720/tips-for-golfing-in-moon)
  * [ What is the purpose of DPMI interrupt 31h function 300h? ](https://retrocomputing.stackexchange.com/questions/31426/what-is-the-purpose-of-dpmi-interrupt-31h-function-300h)
  * [ Is this an acceptable workaround to mounting a rear cargo rack around the rear brake? ](https://bicycles.stackexchange.com/questions/96386/is-this-an-acceptable-workaround-to-mounting-a-rear-cargo-rack-around-the-rear-b)
  * [ Where is the following verse found? ](https://hinduism.stackexchange.com/questions/62553/where-is-the-following-verse-found)
  * [ Can we still use the word "tweet" now that Twitter has been rebranded as X? ](https://ell.stackexchange.com/questions/363209/can-we-still-use-the-word-tweet-now-that-twitter-has-been-rebranded-as-x)
  * [ Are "inland whales" in Oregon property of the governor, and other questions about "royal fish" ](https://law.stackexchange.com/questions/107831/are-inland-whales-in-oregon-property-of-the-governor-and-other-questions-abou)
  * [ Ethernet over double RJ11 ](https://superuser.com/questions/1886962/ethernet-over-double-rj11)

more hot questions 

[ Question feed ](/feeds/question/20060500 "Feed of this question and its answers")

#  Subscribe to RSS 

Question feed 

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

![](/posts/20060500/ivc/76f2?prg=fa914d74-d31d-4b65-b337-d1814c8ecc0b)

[](https://stackoverflow.com)

##### [Stack Overflow](https://stackoverflow.com)

  * [Questions](/questions)
  * [Help](/help)
  * [Chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)



##### [Products](https://stackoverflow.co/)

  * [Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=teams)
  * [Advertising](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=advertising)
  * [Talent](https://stackoverflow.co/advertising/employer-branding/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=talent)



##### [Company](https://stackoverflow.co/)

  * [About](https://stackoverflow.co/)
  * [Press](https://stackoverflow.co/company/press/)
  * [Work Here](https://stackoverflow.co/company/work-here/)
  * [Legal](https://stackoverflow.com/legal)
  * [Privacy Policy](https://stackoverflow.com/legal/privacy-policy)
  * [Terms of Service](https://stackoverflow.com/legal/terms-of-service/public)
  * [Contact Us](/contact)
  * Your Privacy Choices 
  * [Cookie Policy](https://stackoverflow.com/legal/cookie-policy)



##### [Stack Exchange Network](https://stackexchange.com)

  * [ Technology ](https://stackexchange.com/sites#technology)
  * [ Culture & recreation ](https://stackexchange.com/sites#culturerecreation)
  * [ Life & arts ](https://stackexchange.com/sites#lifearts)
  * [ Science ](https://stackexchange.com/sites#science)
  * [ Professional ](https://stackexchange.com/sites#professional)
  * [ Business ](https://stackexchange.com/sites#business)
  * [ API ](https://api.stackexchange.com/)
  * [ Data ](https://data.stackexchange.com/)



  * [Blog](https://stackoverflow.blog?blb=1)
  * [Facebook](https://www.facebook.com/officialstackoverflow/)
  * [Twitter](https://twitter.com/stackoverflow)
  * [LinkedIn](https://linkedin.com/company/stack-overflow)
  * [Instagram](https://www.instagram.com/thestackoverflow)



Site design / logo © 2025 Stack Exchange Inc;  user contributions licensed under  [CC BY-SA](https://stackoverflow.com/help/licensing) .  rev 2025.3.17.23948


title: Error while connecting my azure vm through azure bastion - Stack Overflow
scrape_date: 2025-03-18T12:03:06.375865
content_type: markdown
hash: bc968f98618f9b45a0abf74b99e4a017beefe9b44b1f7d214dfdae206ab49221
url:
https://stackoverflow.com/questions/60734223/error-while-connecting-my-azure-vm-through-azure-bastion

content:
Skip to main content

[ Stack Overflow ](https://stackoverflow.com)

  1. [About](https://stackoverflow.co/)
  2. Products 
  3. [OverflowAI](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav-bar&utm_content=overflowai)



  1. [ Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers ](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-for-teams)
  2. [ Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand ](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-advertising)
  3. [ OverflowAI GenAI features for Teams ](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-ai)
  4. [ OverflowAPI Train & fine-tune LLMs ](https://stackoverflow.co/api-solutions/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-api)
  5. [ Labs The future of collective knowledge sharing ](https://stackoverflow.co/labs/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=labs)
  6. [About the company](https://stackoverflow.co/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=about-the-company) [Visit the blog](https://stackoverflow.blog/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=blog)



Loading…

  1. ###  [current community](https://stackoverflow.com)

     * [ Stack Overflow  ](https://stackoverflow.com)

[help](https://stackoverflow.com/help) [chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)

     * [ Meta Stack Overflow  ](https://meta.stackoverflow.com)

###  your communities 

[Sign up](https://stackoverflow.com/users/signup?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f60734223%2ferror-while-connecting-my-azure-vm-through-azure-bastion) or [log in](https://stackoverflow.com/users/login?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f60734223%2ferror-while-connecting-my-azure-vm-through-azure-bastion) to customize your list. 

### [more stack exchange communities](https://stackexchange.com/sites)

[company blog](https://stackoverflow.blog)

  2.   3. [Log in](https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f60734223%2ferror-while-connecting-my-azure-vm-through-azure-bastion)
  4. [Sign up](https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f60734223%2ferror-while-connecting-my-azure-vm-through-azure-bastion)



  1.     1. [ Home ](/)
    2. [ Questions ](/questions)
    3. [ Tags ](/tags)
    4.     5. [ Users ](/users)
    6. [ Companies ](https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav)
    7. [ Labs ](javascript:void\(0\))
    8. [ Jobs ](/jobs?source=so-left-nav)
    9. [ Discussions ](/beta/discussions)
    10. [ Collectives ](javascript:void\(0\))

    11. Communities for your favorite technologies. [Explore all Collectives](/collectives-all)

  2. Teams

![](https://cdn.sstatic.net/Img/teams/teams-promo.svg?v=e507948b81bf)

Ask questions, find answers and collaborate at work with Stack Overflow for Teams. 

[Try Teams for free](https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams)

  3. [ Teams ](javascript:void\(0\))
  4. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact)




##### Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

[ Learn more about Collectives ](/collectives)

**Teams**

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

[ Learn more about Teams ](https://stackoverflow.co/teams/)

Get early access and see previews of new features.

[ Learn more about Labs](https://stackoverflow.co/labs/)

# [Error while connecting my azure vm through azure bastion](/questions/60734223/error-while-connecting-my-azure-vm-through-azure-bastion)

[ Ask Question ](/questions/ask)

Asked 5 years ago

Modified [today](?lastactivity "2025-03-18 17:00:40Z")

Viewed 11k times 

Part of [Microsoft Azure](/collectives/azure) Collective 

1 

[](/posts/60734223/timeline "Show activity on this post.")

So , i created an azure bastion named "test" under the virtual network "RemoteAccess-Bastion-VN".Under this virtual network i also created a subnet "AzureBastionSubnet" with "/27" range.And when i try to connect my VM through bastion i dont see my bastion , i am asked once again to create a new bastion.I dont know where i am wrong.I think i followed the steps correctly and now i am stuck. [I have attached the pic showing how it looks when i try to connect through bastion , it should show the login credentials page but instead it is asking me to create a new bastion.](https://i.sstatic.net/nv8HS.png)

Thank You

[](/collectives/azure "Microsoft Azure Collective")

  * [azure](/questions/tagged/azure "show questions tagged 'azure'")
  * [azure-virtual-machine](/questions/tagged/azure-virtual-machine "show questions tagged 'azure-virtual-machine'")
  * [azure-virtual-network](/questions/tagged/azure-virtual-network "show questions tagged 'azure-virtual-network'")



[Share](/q/60734223 "Short permalink to this question")

[Improve this question](/posts/60734223/edit)

Follow 

asked Mar 18, 2020 at 6:01

[![Bhavesh Damor's user avatar](https://i.sstatic.net/pniXg.jpg?s=64)](/users/8648314/bhavesh-damor)

[Bhavesh Damor](/users/8648314/bhavesh-damor)Bhavesh Damor

8111 gold badge33 silver badges1515 bronze badges

3

  * It takes about 5 minutes for the Bastion resource to be created and deployed. Are you waiting for that time? If it is deployed well, you will see the notification on the portal.

- [Nancy Xiong](/users/9833314/nancy-xiong "28,324 reputation")

Commented Mar 18, 2020 at 6:26

  * I waited an entire day , still nothing to see any change

- [Bhavesh Damor](/users/8648314/bhavesh-damor "81 reputation")

Commented Mar 18, 2020 at 8:11

  * yes i can see my "test" bastion in my resource group.

- [Bhavesh Damor](/users/8648314/bhavesh-damor "81 reputation")

Commented Mar 19, 2020 at 18:00




Add a comment  | 

##  1 Answer 1

Sorted by:  [ Reset to default ](/questions/60734223/error-while-connecting-my-azure-vm-through-azure-bastion?answertab=scoredesc#tab-top)

Highest score (default)  Trending (recent votes count more)  Date modified (newest first)  Date created (oldest first) 

0 

[](/posts/60752884/timeline "Show activity on this post.")

According to your description, probably, the Azure Bastion service is not provision successfully. If it has been deployed well, you will see the **Bastion** type service in your resource group like this, [![enter image description here](https://i.sstatic.net/wxZoB.jpg)](https://i.sstatic.net/wxZoB.jpg)

Also, from your Virtual machine---Operations---Bastion, you will see the provision status. [![enter image description here](https://i.sstatic.net/seMYt.jpg)](https://i.sstatic.net/seMYt.jpg)

You could follow this [quickstart](https://learn.microsoft.com/en-us/azure/bastion/bastion-create-host-portal#createhost) to create a bastion host. It takes about 5 minutes for the Bastion resource to be created and deployed. Let me know if you still have any question.

## **Edit**

In this case, you need to put the vm and the vnet in the **same region** and created a bastion in the vnet.

[Share](/a/60752884 "Short permalink to this answer")

[Improve this answer](/posts/60752884/edit)

Follow 

[edited Mar 25, 2020 at 6:21](/posts/60752884/revisions "show all edits to this post")

answered Mar 19, 2020 at 7:49

[![Nancy Xiong's user avatar](https://www.gravatar.com/avatar/a892c3ef7550c98e5b437ea1ae52d764?s=64&d=identicon&r=PG&f=y&so-version=2)](/users/9833314/nancy-xiong)

[Nancy Xiong](/users/9833314/nancy-xiong)Nancy Xiong

28.3k33 gold badges2121 silver badges3636 bronze badges

9

  * i have already created three bastions but none of them were of any help , i faced the same error.

- [Bhavesh Damor](/users/8648314/bhavesh-damor "81 reputation")

Commented Mar 19, 2020 at 18:12

  * It's wired. Do you clear the cache in the web explorer or change another explorer? Do you create bastion from creating a resource---new--bastion on the portal? What's your account's permission? Is the account an owner role in your subscription?

- [Nancy Xiong](/users/9833314/nancy-xiong "28,324 reputation")

Commented Mar 20, 2020 at 1:54

  * No , i didnt cleared the cache of the web browser and also i have been working on the same web browser.Yes , i created the bastion from the portal.How to check my account's permission? Also how to check which type of account i am using?

- [Bhavesh Damor](/users/8648314/bhavesh-damor "81 reputation")

Commented Mar 20, 2020 at 7:08

  * Click ctrl+F5 to refresh your browser? Check your permission from bastion---access control(IAM)---role assignment, search your account in the name box, you will see the role and scope mapping to your account.

- [Nancy Xiong](/users/9833314/nancy-xiong "28,324 reputation")

Commented Mar 20, 2020 at 7:13

  * 1

Yes , it worked finally.I put the vm and the vnet in the same region and created a bastion in the vnet.Thank you for your help and time , really appreciate it.

- [Bhavesh Damor](/users/8648314/bhavesh-damor "81 reputation")

Commented Mar 25, 2020 at 6:17




 |  Show **4** more comments

##  Your Answer 

Thanks for contributing an answer to Stack Overflow!

  * Please be sure to _answer the question_. Provide details and share your research!



But _avoid_ …

  * Asking for help, clarification, or responding to other answers.
  * Making statements based on opinion; back them up with references or personal experience.



To learn more, see our [tips on writing great answers](/help/how-to-answer).

Draft saved

Draft discarded

### Sign up or [log in](/users/login?ssrc=question_page&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f60734223%2ferror-while-connecting-my-azure-vm-through-azure-bastion%23new-answer)

Sign up using Google 

Sign up using Email and Password 

Submit

### Post as a guest

Name

Email

Required, but never shown

### Post as a guest

Name

Email

Required, but never shown

Post Your Answer  Discard 

By clicking “Post Your Answer”, you agree to our [terms of service](https://stackoverflow.com/legal/terms-of-service/public) and acknowledge you have read our [privacy policy](https://stackoverflow.com/legal/privacy-policy).

Start asking to get answers

Find the answer to your question by asking.

[Ask question](/questions/ask)

Explore related questions

  * [azure](/questions/tagged/azure "show questions tagged 'azure'")
  * [azure-virtual-machine](/questions/tagged/azure-virtual-machine "show questions tagged 'azure-virtual-machine'")
  * [azure-virtual-network](/questions/tagged/azure-virtual-network "show questions tagged 'azure-virtual-network'")



See similar questions with these tags.

[ Microsoft Azure Collective Join the discussion ](/collectives/azure/beta/discussions)

[ This question is in a collective:](/collectives) a subcommunity defined by tags with relevant content and experts. 

  * The Overflow Blog 
  * [To get ahead with AI, fine-tune your data strategy](https://stackoverflow.blog/2025/03/17/to-get-ahead-with-ai-fine-tune-your-data-strategy/)

  * [Improving error monitoring with AI](https://stackoverflow.blog/2025/03/18/improving-error-monitoring-with-ai/)

  * Featured on Meta 
  * [Community Asks Sprint Announcement - March 2025](https://meta.stackexchange.com/questions/407321/community-asks-sprint-announcement-march-2025)

  * [Experimenting with a new experiment opt-out option](https://meta.stackexchange.com/questions/407547/experimenting-with-a-new-experiment-opt-out-option)

  * [Stacks Editor development and testing](https://meta.stackoverflow.com/questions/433034/stacks-editor-development-and-testing)

  * [Policy: Generative AI (e.g., ChatGPT) is banned](https://meta.stackoverflow.com/questions/421831/policy-generative-ai-e-g-chatgpt-is-banned)

  * [Is it better to redirect users who attempt to perform actions they can't yet...](https://meta.stackoverflow.com/questions/432989/is-it-better-to-redirect-users-who-attempt-to-perform-actions-they-cant-yet-tak "Is it better to redirect users who attempt to perform actions they can't yet take?")




#### Related

[ 2 ](/q/15344594 "Question score \(upvotes - downvotes\)") [Azure Connection Problems](/questions/15344594/azure-connection-problems)

[ 4 ](/q/20313225 "Question score \(upvotes - downvotes\)") [Not able to remote into Windows azure virtual machine](/questions/20313225/not-able-to-remote-into-windows-azure-virtual-machine)

[ 0 ](/q/27376034 "Question score \(upvotes - downvotes\)") [cannot connect to VM in azure](/questions/27376034/cannot-connect-to-vm-in-azure)

[ 0 ](/q/27820105 "Question score \(upvotes - downvotes\)") [Unable to start VM-DeploymentVNetAddressAllocationFailure](/questions/27820105/unable-to-start-vm-deploymentvnetaddressallocationfailure)

[ 0 ](/q/33734645 "Question score \(upvotes - downvotes\)") [Unable to connect to azure vm with internal IP](/questions/33734645/unable-to-connect-to-azure-vm-with-internal-ip)

[ 0 ](/q/38581278 "Question score \(upvotes - downvotes\)") [Cant connect to Linux VM on Azure](/questions/38581278/cant-connect-to-linux-vm-on-azure)

[ 1 ](/q/39674155 "Question score \(upvotes - downvotes\)") [Could not connect to linux VM in Microsoft Azure](/questions/39674155/could-not-connect-to-linux-vm-in-microsoft-azure)

[ 3 ](/q/42073358 "Question score \(upvotes - downvotes\)") [Error connecting to Azure Virtual Network - Point to Site](/questions/42073358/error-connecting-to-azure-virtual-network-point-to-site)

[ 1 ](/q/56606892 "Question score \(upvotes - downvotes\)") [What are the prerequisites for remoting into VNet Windows VM using Azure Bastion?](/questions/56606892/what-are-the-prerequisites-for-remoting-into-vnet-windows-vm-using-azure-bastion)

[ 0 ](/q/60182647 "Question score \(upvotes - downvotes\)") [Get Bastion Shareable Link REST api results into an error](/questions/60182647/get-bastion-shareable-link-rest-api-results-into-an-error)

####  [ Hot Network Questions ](https://stackexchange.com/questions?tab=hot)

  * [ What are these pom pom trees? ](https://gardening.stackexchange.com/questions/67799/what-are-these-pom-pom-trees)
  * [ Minimizing the Sum of Elementwise Products for Three Permutations of a Sequence ](https://math.stackexchange.com/questions/5046871/minimizing-the-sum-of-elementwise-products-for-three-permutations-of-a-sequence)
  * [ How many independent global hotel search engines are there? ](https://travel.stackexchange.com/questions/193772/how-many-independent-global-hotel-search-engines-are-there)
  * [ PMOS Gate Drive in Typical Application Circuit ](https://electronics.stackexchange.com/questions/741796/pmos-gate-drive-in-typical-application-circuit)
  * [ Why did the CF-100 Canuck use straight wings instead of swept wings? ](https://aviation.stackexchange.com/questions/108206/why-did-the-cf-100-canuck-use-straight-wings-instead-of-swept-wings)
  * [ Unless in conditional sentences ](https://ell.stackexchange.com/questions/363259/unless-in-conditional-sentences)
  * [ Clustered Index Update operator performing excessive Logical Reads after query change ](https://dba.stackexchange.com/questions/345758/clustered-index-update-operator-performing-excessive-logical-reads-after-query-c)
  * [ A type theory for curried functions with named/labeled arguments ](https://cstheory.stackexchange.com/questions/55211/a-type-theory-for-curried-functions-with-named-labeled-arguments)
  * [ Fill in the missing numbers in the sequence ](https://puzzling.stackexchange.com/questions/131018/fill-in-the-missing-numbers-in-the-sequence)
  * [ Can I switch from Sales to Data Science/Analysis with no degree in a year? ](https://datascience.stackexchange.com/questions/131582/can-i-switch-from-sales-to-data-science-analysis-with-no-degree-in-a-year)
  * [ What is the idea behind 20. b4 in this position? ](https://chess.stackexchange.com/questions/46785/what-is-the-idea-behind-20-b4-in-this-position)
  * [ Why does Starship launch on a cloud? ](https://space.stackexchange.com/questions/68082/why-does-starship-launch-on-a-cloud)
  * [ How do I center vertically a text in a table cell? ](https://tex.stackexchange.com/questions/739168/how-do-i-center-vertically-a-text-in-a-table-cell)
  * [ Losing StreamStyle in StreamPlot in 14.2 ](https://mathematica.stackexchange.com/questions/311635/losing-streamstyle-in-streamplot-in-14-2)
  * [ Why ever hammer a BB rather than turn to push it out? ](https://bicycles.stackexchange.com/questions/96384/why-ever-hammer-a-bb-rather-than-turn-to-push-it-out)
  * [ Show with a guy that has either super intelligence or computer chip in his brain ](https://scifi.stackexchange.com/questions/295505/show-with-a-guy-that-has-either-super-intelligence-or-computer-chip-in-his-brain)
  * [ Is it common now that Thailand immigration asks for proof of onward travel? ](https://travel.stackexchange.com/questions/193788/is-it-common-now-that-thailand-immigration-asks-for-proof-of-onward-travel)
  * [ Creating sequence diagrams for use cases ](https://softwareengineering.stackexchange.com/questions/456878/creating-sequence-diagrams-for-use-cases)
  * [ A surprisingly difficult fact about bilinear maps ](https://math.stackexchange.com/questions/5046798/a-surprisingly-difficult-fact-about-bilinear-maps)
  * [ Deleting Elements at Matching Positions in Sublists When Zero is Detected in Any Sublist ](https://mathematica.stackexchange.com/questions/311644/deleting-elements-at-matching-positions-in-sublists-when-zero-is-detected-in-any)
  * [ Can I use the same wooden cutting board for vegetables and meat if I cut the vegetables first? ](https://cooking.stackexchange.com/questions/130354/can-i-use-the-same-wooden-cutting-board-for-vegetables-and-meat-if-i-cut-the-veg)
  * [ Do pentesters need to be able to fix their findings for their customers? ](https://security.stackexchange.com/questions/280837/do-pentesters-need-to-be-able-to-fix-their-findings-for-their-customers)
  * [ Are "inland whales" in Oregon property of the governor, and other questions about "royal fish" ](https://law.stackexchange.com/questions/107831/are-inland-whales-in-oregon-property-of-the-governor-and-other-questions-abou)
  * [ Distributing a library under a license different than its examples ](https://opensource.stackexchange.com/questions/15411/distributing-a-library-under-a-license-different-than-its-examples)

more hot questions 

[ Question feed ](/feeds/question/60734223 "Feed of this question and its answers")

#  Subscribe to RSS 

Question feed 

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

![](/posts/60734223/ivc/76f2?prg=9931d083-5d17-4851-b62c-6fb580500d7c)

[](https://stackoverflow.com)

##### [Stack Overflow](https://stackoverflow.com)

  * [Questions](/questions)
  * [Help](/help)
  * [Chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)



##### [Products](https://stackoverflow.co/)

  * [Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=teams)
  * [Advertising](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=advertising)
  * [Talent](https://stackoverflow.co/advertising/employer-branding/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=talent)



##### [Company](https://stackoverflow.co/)

  * [About](https://stackoverflow.co/)
  * [Press](https://stackoverflow.co/company/press/)
  * [Work Here](https://stackoverflow.co/company/work-here/)
  * [Legal](https://stackoverflow.com/legal)
  * [Privacy Policy](https://stackoverflow.com/legal/privacy-policy)
  * [Terms of Service](https://stackoverflow.com/legal/terms-of-service/public)
  * [Contact Us](/contact)
  * Your Privacy Choices 
  * [Cookie Policy](https://stackoverflow.com/legal/cookie-policy)



##### [Stack Exchange Network](https://stackexchange.com)

  * [ Technology ](https://stackexchange.com/sites#technology)
  * [ Culture & recreation ](https://stackexchange.com/sites#culturerecreation)
  * [ Life & arts ](https://stackexchange.com/sites#lifearts)
  * [ Science ](https://stackexchange.com/sites#science)
  * [ Professional ](https://stackexchange.com/sites#professional)
  * [ Business ](https://stackexchange.com/sites#business)
  * [ API ](https://api.stackexchange.com/)
  * [ Data ](https://data.stackexchange.com/)



  * [Blog](https://stackoverflow.blog?blb=1)
  * [Facebook](https://www.facebook.com/officialstackoverflow/)
  * [Twitter](https://twitter.com/stackoverflow)
  * [LinkedIn](https://linkedin.com/company/stack-overflow)
  * [Instagram](https://www.instagram.com/thestackoverflow)



Site design / logo © 2025 Stack Exchange Inc;  user contributions licensed under  [CC BY-SA](https://stackoverflow.com/help/licensing) .  rev 2025.3.17.23948


scrape_date: 2025-03-18T12:03:06.375470
content_type: markdown
hash: 78336bd4a8a9d0835813e15d54a7b4ad8daefcf1f3b1c112c87ef170e6a1525c
url:
https://stackoverflow.com/questions/78786174/auth-js-v5-google-login-in-the-production-environment-redirects-to-https-local

title:
next.js - Auth.js v5 Google login in the production environment redirects to https://localhost after logging in success - Stack Overflow

content:
Skip to main content

[ Stack Overflow ](https://stackoverflow.com)

  1. [About](https://stackoverflow.co/)
  2. Products 
  3. [OverflowAI](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav-bar&utm_content=overflowai)



  1. [ Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers ](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-for-teams)
  2. [ Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand ](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-advertising)
  3. [ OverflowAI GenAI features for Teams ](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-ai)
  4. [ OverflowAPI Train & fine-tune LLMs ](https://stackoverflow.co/api-solutions/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-api)
  5. [ Labs The future of collective knowledge sharing ](https://stackoverflow.co/labs/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=labs)
  6. [About the company](https://stackoverflow.co/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=about-the-company) [Visit the blog](https://stackoverflow.blog/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=blog)



Loading…

  1. ###  [current community](https://stackoverflow.com)

     * [ Stack Overflow  ](https://stackoverflow.com)

[help](https://stackoverflow.com/help) [chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)

     * [ Meta Stack Overflow  ](https://meta.stackoverflow.com)

###  your communities 

[Sign up](https://stackoverflow.com/users/signup?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f78786174%2fauth-js-v5-google-login-in-the-production-environment-redirects-to-https-local) or [log in](https://stackoverflow.com/users/login?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f78786174%2fauth-js-v5-google-login-in-the-production-environment-redirects-to-https-local) to customize your list. 

### [more stack exchange communities](https://stackexchange.com/sites)

[company blog](https://stackoverflow.blog)

  2.   3. [Log in](https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f78786174%2fauth-js-v5-google-login-in-the-production-environment-redirects-to-https-local)
  4. [Sign up](https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f78786174%2fauth-js-v5-google-login-in-the-production-environment-redirects-to-https-local)



  1.     1. [ Home ](/)
    2. [ Questions ](/questions)
    3. [ Tags ](/tags)
    4.     5. [ Users ](/users)
    6. [ Companies ](https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav)
    7. [ Labs ](javascript:void\(0\))
    8. [ Jobs ](/jobs?source=so-left-nav)
    9. [ Discussions ](/beta/discussions)
    10. [ Collectives ](javascript:void\(0\))

    11. Communities for your favorite technologies. [Explore all Collectives](/collectives-all)

  2. Teams

![](https://cdn.sstatic.net/Img/teams/teams-promo.svg?v=e507948b81bf)

Ask questions, find answers and collaborate at work with Stack Overflow for Teams. 

[Try Teams for free](https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams)

  3. [ Teams ](javascript:void\(0\))
  4. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact)




##### Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

[ Learn more about Collectives ](/collectives)

**Teams**

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

[ Learn more about Teams ](https://stackoverflow.co/teams/)

Get early access and see previews of new features.

[ Learn more about Labs](https://stackoverflow.co/labs/)

# [Auth.js v5 Google login in the production environment redirects to https://localhost after logging in success](/questions/78786174/auth-js-v5-google-login-in-the-production-environment-redirects-to-https-local)

[ Ask Question ](/questions/ask)

Asked 7 months ago

Modified [today](?lastactivity "2025-03-18 17:01:50Z")

Viewed 175 times 

0 

[](/posts/78786174/timeline "Show activity on this post.")

this is my google login action
    
    
    "use server";
    
    import { AuthError } from "next-auth";
    import { signIn } from "@/auth";
    
    
    export const googleLogin = async () => {
    
      try {
        await signIn("google",{
          redirectTo: "/",
        });
      } catch (error) {
        if (error instanceof AuthError) {
          switch (error.type) {
            case "OAuthCallbackError":
              return { error: "Google login failed!" };
            default:
              return { error: "Something went wrong!" };
          }
        }
    
        throw error;
      }
    };
    

It works well in local, and I have successfully logged in. However, after deploying it to AWS, it redirects to https://localhost:3000 after a successful login.

I have set the environment variable AUTH_REDIRECT_PROXY_URL=https://www.yourdomain.com, and also tried setting the redirect in auth.ts, but it has no work.

auth.ts
    
    
    ...
        async signIn({ user, account, profile, email, credentials }) {
          return true
        },
        async redirect({ url, baseUrl }) {
          return baseUrl
        },
    ...
    }
    

  * [next.js](/questions/tagged/next.js "show questions tagged 'next.js'")
  * [next-auth](/questions/tagged/next-auth "show questions tagged 'next-auth'")
  * [react-google-login](/questions/tagged/react-google-login "show questions tagged 'react-google-login'")



[Share](/q/78786174 "Short permalink to this question")

[Improve this question](/posts/78786174/edit)

Follow 

[edited Jul 27, 2024 at 4:19](/posts/78786174/revisions "show all edits to this post")

[![Invulner's user avatar](https://www.gravatar.com/avatar/abfa83a3c95feb24fb07c3ecaead478a?s=64&d=identicon&r=PG&f=y&so-version=2)](/users/21288555/invulner)

[Invulner](/users/21288555/invulner)

2,05111 gold badge66 silver badges1717 bronze badges

asked Jul 24, 2024 at 2:25

[![YAN MING HUANG's user avatar](https://lh3.googleusercontent.com/a/AATXAJxQYhbNBm-xi9MhBhkKcrpt5fT6yQWwkHIYCkYu=k-s64)](/users/16303080/yan-ming-huang)

[YAN MING HUANG](/users/16303080/yan-ming-huang)YAN MING HUANG

1




Add a comment  | 

##  2 Answers 2

Sorted by:  [ Reset to default ](/questions/78786174/auth-js-v5-google-login-in-the-production-environment-redirects-to-https-local?answertab=scoredesc#tab-top)

Highest score (default)  Trending (recent votes count more)  Date modified (newest first)  Date created (oldest first) 

0 

[](/posts/78796067/timeline "Show activity on this post.")

You need
    
    
    NEXTAUTH_URL="https://yourdomain.com"
    AUTH_TRUST_HOST="true"
    

in your environment file. You also want to make sure under Google Cloud > APIs & Services > Credentials > Oauth > Authorized Javscript origins, you have an entry for `https://yourdomain.com` as an authorized origin, and `https://yourdomain.com/api/auth/callback/google` as redirect URI.

[Share](/a/78796067 "Short permalink to this answer")

[Improve this answer](/posts/78796067/edit)

Follow 

answered Jul 26, 2024 at 2:51

[![darksky's user avatar](https://www.gravatar.com/avatar/a978a451c67d355f999c0dcb430b6594?s=64&d=identicon&r=PG)](/users/1362294/darksky)

[darksky](/users/1362294/darksky)darksky

2,1001818 silver badges3131 bronze badges




Add a comment  | 

0 

[](/posts/79518194/timeline "Show activity on this post.")

Having similar problems. How did you solve the problem?

[Share](/a/79518194 "Short permalink to this answer")

Follow 

answered 1 min ago

[![fixxel's user avatar](https://www.gravatar.com/avatar/0c256fe887cf74deb8ba46d35cfd60d4?s=64&d=identicon&r=PG&f=y&so-version=2)](/users/14818168/fixxel)

[fixxel](/users/14818168/fixxel)fixxel

18711 silver badge88 bronze badges




Add a comment  | 

##  Your Answer 

**Reminder:** Answers generated by AI tools are not allowed due to Stack Overflow's [artificial intelligence policy](/help/gen-ai-policy)

Thanks for contributing an answer to Stack Overflow!

  * Please be sure to _answer the question_. Provide details and share your research!



But _avoid_ …

  * Asking for help, clarification, or responding to other answers.
  * Making statements based on opinion; back them up with references or personal experience.



To learn more, see our [tips on writing great answers](/help/how-to-answer).

Draft saved

Draft discarded

### Sign up or [log in](/users/login?ssrc=question_page&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f78786174%2fauth-js-v5-google-login-in-the-production-environment-redirects-to-https-local%23new-answer)

Sign up using Google 

Sign up using Email and Password 

Submit

### Post as a guest

Name

Email

Required, but never shown

### Post as a guest

Name

Email

Required, but never shown

Post Your Answer  Discard 

By clicking “Post Your Answer”, you agree to our [terms of service](https://stackoverflow.com/legal/terms-of-service/public) and acknowledge you have read our [privacy policy](https://stackoverflow.com/legal/privacy-policy).

Start asking to get answers

Find the answer to your question by asking.

[Ask question](/questions/ask)

Explore related questions

  * [next.js](/questions/tagged/next.js "show questions tagged 'next.js'")
  * [next-auth](/questions/tagged/next-auth "show questions tagged 'next-auth'")
  * [react-google-login](/questions/tagged/react-google-login "show questions tagged 'react-google-login'")



See similar questions with these tags.

  * The Overflow Blog 
  * [To get ahead with AI, fine-tune your data strategy](https://stackoverflow.blog/2025/03/17/to-get-ahead-with-ai-fine-tune-your-data-strategy/)

  * [Improving error monitoring with AI](https://stackoverflow.blog/2025/03/18/improving-error-monitoring-with-ai/)

  * Featured on Meta 
  * [Community Asks Sprint Announcement - March 2025](https://meta.stackexchange.com/questions/407321/community-asks-sprint-announcement-march-2025)

  * [Experimenting with a new experiment opt-out option](https://meta.stackexchange.com/questions/407547/experimenting-with-a-new-experiment-opt-out-option)

  * [Stacks Editor development and testing](https://meta.stackoverflow.com/questions/433034/stacks-editor-development-and-testing)

  * [Policy: Generative AI (e.g., ChatGPT) is banned](https://meta.stackoverflow.com/questions/421831/policy-generative-ai-e-g-chatgpt-is-banned)

  * [Is it better to redirect users who attempt to perform actions they can't yet...](https://meta.stackoverflow.com/questions/432989/is-it-better-to-redirect-users-who-attempt-to-perform-actions-they-cant-yet-tak "Is it better to redirect users who attempt to perform actions they can't yet take?")




#### Related

[ 5 ](/q/71733194 "Question score \(upvotes - downvotes\)") [Custom Login Form Error : Redirecting to https://localhost:3000/api/auth/signin?csrf=true using CredentialsProvider](/questions/71733194/custom-login-form-error-redirecting-to-https-localhost3000-api-auth-signin)

[ 4 ](/q/74180557 "Question score \(upvotes - downvotes\)") [next-auth [next-auth][error][CLIENT_FETCH_ERROR] NetworkError when attempting to fetch resource](/questions/74180557/next-auth-next-autherrorclient-fetch-error-networkerror-when-attempting-to)

[ 4 ](/q/76485086 "Question score \(upvotes - downvotes\)") [How to resolve Access Denied Error in Next js 13.4 using Next Auth Google Sign In and MongoDB](/questions/76485086/how-to-resolve-access-denied-error-in-next-js-13-4-using-next-auth-google-sign-i)

[ 0 ](/q/74772385 "Question score \(upvotes - downvotes\)") [NexAuth.js cannot connect to Google. Error 500](/questions/74772385/nexauth-js-cannot-connect-to-google-error-500)

[ 1 ](/q/75125443 "Question score \(upvotes - downvotes\)") [failed login redirects me to /api/auth/error on next-auth](/questions/75125443/failed-login-redirects-me-to-api-auth-error-on-next-auth)

[ 1 ](/q/77927206 "Question score \(upvotes - downvotes\)") [Next.js and auth.js, callbakrouteerror](/questions/77927206/next-js-and-auth-js-callbakrouteerror)

####  [ Hot Network Questions ](https://stackexchange.com/questions?tab=hot)

  * [ What are the disadvantages of a battery powered micro pump over CO₂ inflaters for roadside puncture repairs? ](https://bicycles.stackexchange.com/questions/96375/what-are-the-disadvantages-of-a-battery-powered-micro-pump-over-co%e2%82%82-inflaters-fo)
  * [ Lucas sequence inequality ](https://math.stackexchange.com/questions/5046727/lucas-sequence-inequality)
  * [ Understanding why ghost version records in SQL server 2019 exists across application server restarts? ](https://dba.stackexchange.com/questions/345755/understanding-why-ghost-version-records-in-sql-server-2019-exists-across-applica)
  * [ CEO of startup is becoming more and more incoherent ](https://workplace.stackexchange.com/questions/200561/ceo-of-startup-is-becoming-more-and-more-incoherent)
  * [ What happens if Flixbus doesn't assign a seat on the ticket? ](https://travel.stackexchange.com/questions/193776/what-happens-if-flixbus-doesnt-assign-a-seat-on-the-ticket)
  * [ Losing StreamStyle in StreamPlot in 14.2 ](https://mathematica.stackexchange.com/questions/311635/losing-streamstyle-in-streamplot-in-14-2)
  * [ Distributing a library under a license different than its examples ](https://opensource.stackexchange.com/questions/15411/distributing-a-library-under-a-license-different-than-its-examples)
  * [ Ethernet over double RJ11 ](https://superuser.com/questions/1886962/ethernet-over-double-rj11)
  * [ Tips for golfing in ☾ (Moon) ](https://codegolf.stackexchange.com/questions/278720/tips-for-golfing-in-moon)
  * [ Entering USA as an Iranian Born naturalized British Citizen ](https://travel.stackexchange.com/questions/193780/entering-usa-as-an-iranian-born-naturalized-british-citizen)
  * [ Clustered Index Update operator performing excessive Logical Reads after query change ](https://dba.stackexchange.com/questions/345758/clustered-index-update-operator-performing-excessive-logical-reads-after-query-c)
  * [ Closed-source licensing of OS with Linux kernel ](https://opensource.stackexchange.com/questions/15414/closed-source-licensing-of-os-with-linux-kernel)
  * [ Is it customary for financial offers to be in writing? ](https://academia.stackexchange.com/questions/217404/is-it-customary-for-financial-offers-to-be-in-writing)
  * [ Can I use the same wooden cutting board for vegetables and meat if I cut the vegetables first? ](https://cooking.stackexchange.com/questions/130354/can-i-use-the-same-wooden-cutting-board-for-vegetables-and-meat-if-i-cut-the-veg)
  * [ What happens if I choose to pay Vik back or not? ](https://gaming.stackexchange.com/questions/411558/what-happens-if-i-choose-to-pay-vik-back-or-not)
  * [ A pet in a city ](https://puzzling.stackexchange.com/questions/131008/a-pet-in-a-city)
  * [ What is the difference between non existence and existence outside of space and time? ](https://philosophy.stackexchange.com/questions/123524/what-is-the-difference-between-non-existence-and-existence-outside-of-space-and)
  * [ What size breaker do I need for a 31.25 Amp heater? ](https://diy.stackexchange.com/questions/315950/what-size-breaker-do-i-need-for-a-31-25-amp-heater)
  * [ Why does Starship launch on a cloud? ](https://space.stackexchange.com/questions/68082/why-does-starship-launch-on-a-cloud)
  * [ Minimizing the Sum of Elementwise Products for Three Permutations of a Sequence ](https://math.stackexchange.com/questions/5046871/minimizing-the-sum-of-elementwise-products-for-three-permutations-of-a-sequence)
  * [ A surprisingly difficult fact about bilinear maps ](https://math.stackexchange.com/questions/5046798/a-surprisingly-difficult-fact-about-bilinear-maps)
  * [ Is having over 1 mil edges a bad thing? ](https://blender.stackexchange.com/questions/332443/is-having-over-1-mil-edges-a-bad-thing)
  * [ What does tying up the strongman mean in Matthew 12? ](https://hermeneutics.stackexchange.com/questions/102376/what-does-tying-up-the-strongman-mean-in-matthew-12)
  * [ Quiz game in C V1.0 ](https://codereview.stackexchange.com/questions/295672/quiz-game-in-c-v1-0)

more hot questions 

[ Question feed ](/feeds/question/78786174 "Feed of this question and its answers")

#  Subscribe to RSS 

Question feed 

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

![](/posts/78786174/ivc/76f2?prg=35cf3140-5956-4c4b-bf30-6b427b31e20e)

[](https://stackoverflow.com)

##### [Stack Overflow](https://stackoverflow.com)

  * [Questions](/questions)
  * [Help](/help)
  * [Chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)



##### [Products](https://stackoverflow.co/)

  * [Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=teams)
  * [Advertising](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=advertising)
  * [Talent](https://stackoverflow.co/advertising/employer-branding/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=talent)



##### [Company](https://stackoverflow.co/)

  * [About](https://stackoverflow.co/)
  * [Press](https://stackoverflow.co/company/press/)
  * [Work Here](https://stackoverflow.co/company/work-here/)
  * [Legal](https://stackoverflow.com/legal)
  * [Privacy Policy](https://stackoverflow.com/legal/privacy-policy)
  * [Terms of Service](https://stackoverflow.com/legal/terms-of-service/public)
  * [Contact Us](/contact)
  * Your Privacy Choices 
  * [Cookie Policy](https://stackoverflow.com/legal/cookie-policy)



##### [Stack Exchange Network](https://stackexchange.com)

  * [ Technology ](https://stackexchange.com/sites#technology)
  * [ Culture & recreation ](https://stackexchange.com/sites#culturerecreation)
  * [ Life & arts ](https://stackexchange.com/sites#lifearts)
  * [ Science ](https://stackexchange.com/sites#science)
  * [ Professional ](https://stackexchange.com/sites#professional)
  * [ Business ](https://stackexchange.com/sites#business)
  * [ API ](https://api.stackexchange.com/)
  * [ Data ](https://data.stackexchange.com/)



  * [Blog](https://stackoverflow.blog?blb=1)
  * [Facebook](https://www.facebook.com/officialstackoverflow/)
  * [Twitter](https://twitter.com/stackoverflow)
  * [LinkedIn](https://linkedin.com/company/stack-overflow)
  * [Instagram](https://www.instagram.com/thestackoverflow)



Site design / logo © 2025 Stack Exchange Inc;  user contributions licensed under  [CC BY-SA](https://stackoverflow.com/help/licensing) .  rev 2025.3.17.23948


url: https://stackoverflow.com/questions/79518195/blaze-persistence-subquery-from-complex-query
title: java - Blaze Persistence subquery from complex query - Stack Overflow
scrape_date: 2025-03-18T12:03:06.375859
content_type: markdown
hash: 2f7e975a70c371ba5df0599f8563a5605cf0ba695e2d206315ae358f18a9948e
content:
Skip to main content

[ Stack Overflow ](https://stackoverflow.com)

  1. [About](https://stackoverflow.co/)
  2. Products 
  3. [OverflowAI](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav-bar&utm_content=overflowai)



  1. [ Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers ](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-for-teams)
  2. [ Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand ](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-advertising)
  3. [ OverflowAI GenAI features for Teams ](https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-ai)
  4. [ OverflowAPI Train & fine-tune LLMs ](https://stackoverflow.co/api-solutions/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-api)
  5. [ Labs The future of collective knowledge sharing ](https://stackoverflow.co/labs/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=labs)
  6. [About the company](https://stackoverflow.co/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=about-the-company) [Visit the blog](https://stackoverflow.blog/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=blog)



Loading…

  1. ###  [current community](https://stackoverflow.com)

     * [ Stack Overflow  ](https://stackoverflow.com)

[help](https://stackoverflow.com/help) [chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)

     * [ Meta Stack Overflow  ](https://meta.stackoverflow.com)

###  your communities 

[Sign up](https://stackoverflow.com/users/signup?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518195%2fblaze-persistence-subquery-from-complex-query) or [log in](https://stackoverflow.com/users/login?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518195%2fblaze-persistence-subquery-from-complex-query) to customize your list. 

### [more stack exchange communities](https://stackexchange.com/sites)

[company blog](https://stackoverflow.blog)

  2.   3. [Log in](https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518195%2fblaze-persistence-subquery-from-complex-query)
  4. [Sign up](https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518195%2fblaze-persistence-subquery-from-complex-query)



  1.     1. [ Home ](/)
    2. [ Questions ](/questions)
    3. [ Tags ](/tags)
    4.     5. [ Users ](/users)
    6. [ Companies ](https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav)
    7. [ Labs ](javascript:void\(0\))
    8. [ Jobs ](/jobs?source=so-left-nav)
    9. [ Discussions ](/beta/discussions)
    10. [ Collectives ](javascript:void\(0\))

    11. Communities for your favorite technologies. [Explore all Collectives](/collectives-all)

  2. Teams

![](https://cdn.sstatic.net/Img/teams/teams-promo.svg?v=e507948b81bf)

Ask questions, find answers and collaborate at work with Stack Overflow for Teams. 

[Try Teams for free](https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams)

  3. [ Teams ](javascript:void\(0\))
  4. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact)




##### Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

[ Learn more about Collectives ](/collectives)

**Teams**

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

[ Learn more about Teams ](https://stackoverflow.co/teams/)

Get early access and see previews of new features.

[ Learn more about Labs](https://stackoverflow.co/labs/)

# [Blaze Persistence subquery from complex query](/questions/79518195/blaze-persistence-subquery-from-complex-query)

[ Ask Question ](/questions/ask)

Asked today

Modified [today](?lastactivity "2025-03-18 17:02:29Z")

Viewed 1 time 

0 

[](/posts/79518195/timeline "Show activity on this post.")

I am working on a very big project that blaze persistence is it’s core. We have a very complex architecture that eventually, all db operations relay on a specific blaze query that looks like so:
    
    
     return criteriaBuilder  
     .from(entityClass, "entityData")  
     .innerJoinOn(ChangeData.class, "changes")  
     .on("changes.id").eqExpression("entityData.id")  
     .end()  
     .select("entityData")  
     .select("ROW_NUMBER() OVER (PARTITION BY changes.id ORDER BY changes.sequence DESC)", "rn")  
     .select("changes.id", "changes_id")  
     .select("changes. sequence")  
     .selectNew(entityObjectBuilder);  
    

Now I want to wrap this entire cb output like so:
    
    
     Select * from (the above cb sql output) where rn = 1;  
     //some sort of a group by changes.id by max changes.sequence  
    

I have a few problems with this:

If I do .fromSubquery I would have to manually bind all attributes of entityClass which is not possible because I get it as in input (it is suppose to be generic.)

I can’t figure out how to make it work with .fromEntitySubquery because of lack of knowledge and example on the Internet…

I tried to do the following:
    
    
    return criteriaBuilder  
    .fromEntitySubquery(entityClass, "entityDataGroupedById")  
    .from(entityClass, "entityData")  
    .innerJoinOn(ChangeData.class, "changes")  
    .on("changes.id").eqExpression("entityData.id")  
    .end()  
    .where("rn").eq(1)  
    .end()  
    .select("entityData")  
    .select ("ROW_NUMBER() OVER (PARTITION BY changes.id ORDER BY changes.sequence DESC)", "rn")  
    .select("changes.id", "changes_id")  
    .select("changes. sequence")  
    .selectNew(entityObjectBuilder);
    

  * [java](/questions/tagged/java "show questions tagged 'java'")
  * [hibernate](/questions/tagged/hibernate "show questions tagged 'hibernate'")
  * [hibernate-criteria](/questions/tagged/hibernate-criteria "show questions tagged 'hibernate-criteria'")
  * [blaze-persistence](/questions/tagged/blaze-persistence "show questions tagged 'blaze-persistence'")
  * [criteriabuilder](/questions/tagged/criteriabuilder "show questions tagged 'criteriabuilder'")



[Share](/q/79518195 "Short permalink to this question")

Follow 

asked 36 secs ago

[![fishi's user avatar](https://www.gravatar.com/avatar/6156ed6208e7025f7fb9db409e7b17e0?s=64&d=identicon&r=PG&f=y&so-version=2)](/users/27510305/fishi)

[fishi](/users/27510305/fishi)fishi

111 bronze badge

New contributor

[fishi](/users/27510305/fishi) is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our [Code of Conduct](/conduct). 




Add a comment  | 

##  0

Sorted by:  [ Reset to default ](/questions/79518195/blaze-persistence-subquery-from-complex-query?answertab=scoredesc#tab-top)

Highest score (default)  Trending (recent votes count more)  Date modified (newest first)  Date created (oldest first) 

##  Know someone who can answer? Share a link to this [question](https://stackoverflow.com/questions/79518195/blaze-persistence-subquery-from-complex-query) via [email](/cdn-cgi/l/email-protection#a19ed2d4c3cbc4c2d59cf2d5c0c2ca849391eed7c4d3c7cdced6849391f0d4c4d2d5c8cecf87c0ccd19ac3cec5d89ce3cdc0dbc4849391f1c4d3d2c8d2d5c4cfc2c4849391d2d4c3d0d4c4d3d8849391c7d3cecc849391c2ceccd1cdc4d9849391d0d4c4d3d88491e0c9d5d5d1d28492c08493c78493c7d2d5c0c2caced7c4d3c7cdced68fc2cecc8493c7d08493c796989490999098948492c7d2c4cc8492c593), [Twitter](https://twitter.com/share?url=https%3a%2f%2fstackoverflow.com%2fq%2f79518195%3fstw%3d2), or [Facebook](https://www.facebook.com/sharer.php?u=https%3a%2f%2fstackoverflow.com%2fq%2f79518195%3fsfb%3d2). 

##  Your Answer 

Thanks for contributing an answer to Stack Overflow!

  * Please be sure to _answer the question_. Provide details and share your research!



But _avoid_ …

  * Asking for help, clarification, or responding to other answers.
  * Making statements based on opinion; back them up with references or personal experience.



To learn more, see our [tips on writing great answers](/help/how-to-answer).

Draft saved

Draft discarded

### Sign up or [log in](/users/login?ssrc=question_page&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f79518195%2fblaze-persistence-subquery-from-complex-query%23new-answer)

Sign up using Google 

Sign up using Email and Password 

Submit

### Post as a guest

Name

Email

Required, but never shown

### Post as a guest

Name

Email

Required, but never shown

Post Your Answer  Discard 

By clicking “Post Your Answer”, you agree to our [terms of service](https://stackoverflow.com/legal/terms-of-service/public) and acknowledge you have read our [privacy policy](https://stackoverflow.com/legal/privacy-policy).

Start asking to get answers

Find the answer to your question by asking.

[Ask question](/questions/ask)

Explore related questions

  * [java](/questions/tagged/java "show questions tagged 'java'")
  * [hibernate](/questions/tagged/hibernate "show questions tagged 'hibernate'")
  * [hibernate-criteria](/questions/tagged/hibernate-criteria "show questions tagged 'hibernate-criteria'")
  * [blaze-persistence](/questions/tagged/blaze-persistence "show questions tagged 'blaze-persistence'")
  * [criteriabuilder](/questions/tagged/criteriabuilder "show questions tagged 'criteriabuilder'")



See similar questions with these tags.

  * The Overflow Blog 
  * [To get ahead with AI, fine-tune your data strategy](https://stackoverflow.blog/2025/03/17/to-get-ahead-with-ai-fine-tune-your-data-strategy/)

  * [Improving error monitoring with AI](https://stackoverflow.blog/2025/03/18/improving-error-monitoring-with-ai/)

  * Featured on Meta 
  * [Community Asks Sprint Announcement - March 2025](https://meta.stackexchange.com/questions/407321/community-asks-sprint-announcement-march-2025)

  * [Experimenting with a new experiment opt-out option](https://meta.stackexchange.com/questions/407547/experimenting-with-a-new-experiment-opt-out-option)

  * [Stacks Editor development and testing](https://meta.stackoverflow.com/questions/433034/stacks-editor-development-and-testing)

  * [Policy: Generative AI (e.g., ChatGPT) is banned](https://meta.stackoverflow.com/questions/421831/policy-generative-ai-e-g-chatgpt-is-banned)

  * [Is it better to redirect users who attempt to perform actions they can't yet...](https://meta.stackoverflow.com/questions/432989/is-it-better-to-redirect-users-who-attempt-to-perform-actions-they-cant-yet-tak "Is it better to redirect users who attempt to perform actions they can't yet take?")




####  [ Hot Network Questions ](https://stackexchange.com/questions?tab=hot)

  * [ rotate a defined object ](https://tex.stackexchange.com/questions/739185/rotate-a-defined-object)
  * [ Material used for pannier backing ](https://bicycles.stackexchange.com/questions/96388/material-used-for-pannier-backing)
  * [ What size breaker do I need for a 31.25 Amp heater? ](https://diy.stackexchange.com/questions/315950/what-size-breaker-do-i-need-for-a-31-25-amp-heater)
  * [ Enter to USA having Iranian father ](https://travel.stackexchange.com/questions/193756/enter-to-usa-having-iranian-father)
  * [ Teach me how to use directlua tonumber? ](https://tex.stackexchange.com/questions/739173/teach-me-how-to-use-directlua-tonumber)
  * [ Understanding why ghost version records in SQL server 2019 exists across application server restarts? ](https://dba.stackexchange.com/questions/345755/understanding-why-ghost-version-records-in-sql-server-2019-exists-across-applica)
  * [ CEO of startup is becoming more and more incoherent ](https://workplace.stackexchange.com/questions/200561/ceo-of-startup-is-becoming-more-and-more-incoherent)
  * [ Why ever hammer a BB rather than turn to push it out? ](https://bicycles.stackexchange.com/questions/96384/why-ever-hammer-a-bb-rather-than-turn-to-push-it-out)
  * [ Is there a way to show a (6,3) Hamming code using Venn Diagrams? ](https://math.stackexchange.com/questions/5046931/is-there-a-way-to-show-a-6-3-hamming-code-using-venn-diagrams)
  * [ Dataset links provided in the paper not working, authors not responding, next steps? ](https://academia.stackexchange.com/questions/217418/dataset-links-provided-in-the-paper-not-working-authors-not-responding-next-st)
  * [ Lucas sequence inequality ](https://math.stackexchange.com/questions/5046727/lucas-sequence-inequality)
  * [ Why does Starship launch on a cloud? ](https://space.stackexchange.com/questions/68082/why-does-starship-launch-on-a-cloud)
  * [ Shortest unrestricted path to touch every square in an n by n grid ](https://codereview.stackexchange.com/questions/295685/shortest-unrestricted-path-to-touch-every-square-in-an-n-by-n-grid)
  * [ Where is the following verse found? ](https://hinduism.stackexchange.com/questions/62553/where-is-the-following-verse-found)
  * [ Is this an acceptable workaround to mounting a rear cargo rack around the rear brake? ](https://bicycles.stackexchange.com/questions/96386/is-this-an-acceptable-workaround-to-mounting-a-rear-cargo-rack-around-the-rear-b)
  * [ Entering USA as an Iranian Born naturalized British Citizen ](https://travel.stackexchange.com/questions/193780/entering-usa-as-an-iranian-born-naturalized-british-citizen)
  * [ How would humans need to adapt in order to survive in overgrown world? ](https://worldbuilding.stackexchange.com/questions/265367/how-would-humans-need-to-adapt-in-order-to-survive-in-overgrown-world)
  * [ Distributing a library under a license different than its examples ](https://opensource.stackexchange.com/questions/15411/distributing-a-library-under-a-license-different-than-its-examples)
  * [ Latex expl3 : assigning a value to a variable with tl_gset ](https://tex.stackexchange.com/questions/739190/latex-expl3-assigning-a-value-to-a-variable-with-tl-gset)
  * [ Can we still use the word "tweet" now that Twitter has been rebranded as X? ](https://ell.stackexchange.com/questions/363209/can-we-still-use-the-word-tweet-now-that-twitter-has-been-rebranded-as-x)
  * [ How to make the weather matter? ](https://rpg.stackexchange.com/questions/214997/how-to-make-the-weather-matter)
  * [ Starting with a pile of 1,001 rocks, discarding some and splitting up the piles, can you eventually have all piles with exactly 3 rocks? ](https://puzzling.stackexchange.com/questions/130977/starting-with-a-pile-of-1-001-rocks-discarding-some-and-splitting-up-the-piles)
  * [ What happens if Flixbus doesn't assign a seat on the ticket? ](https://travel.stackexchange.com/questions/193776/what-happens-if-flixbus-doesnt-assign-a-seat-on-the-ticket)
  * [ Simplest problems showing that "Spec Z is where schemes really shine" ](https://math.stackexchange.com/questions/5046936/simplest-problems-showing-that-spec-z-is-where-schemes-really-shine)

more hot questions 

[ Question feed ](/feeds/question/79518195 "Feed of this question and its answers")

#  Subscribe to RSS 

Question feed 

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

![](/posts/79518195/ivc/76f2?prg=1f0d7cd4-e787-47d0-86c9-1bf740f08360)

lang-java

[](https://stackoverflow.com)

##### [Stack Overflow](https://stackoverflow.com)

  * [Questions](/questions)
  * [Help](/help)
  * [Chat](https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com)



##### [Products](https://stackoverflow.co/)

  * [Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=teams)
  * [Advertising](https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=advertising)
  * [Talent](https://stackoverflow.co/advertising/employer-branding/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=talent)



##### [Company](https://stackoverflow.co/)

  * [About](https://stackoverflow.co/)
  * [Press](https://stackoverflow.co/company/press/)
  * [Work Here](https://stackoverflow.co/company/work-here/)
  * [Legal](https://stackoverflow.com/legal)
  * [Privacy Policy](https://stackoverflow.com/legal/privacy-policy)
  * [Terms of Service](https://stackoverflow.com/legal/terms-of-service/public)
  * [Contact Us](/contact)
  * Your Privacy Choices 
  * [Cookie Policy](https://stackoverflow.com/legal/cookie-policy)



##### [Stack Exchange Network](https://stackexchange.com)

  * [ Technology ](https://stackexchange.com/sites#technology)
  * [ Culture & recreation ](https://stackexchange.com/sites#culturerecreation)
  * [ Life & arts ](https://stackexchange.com/sites#lifearts)
  * [ Science ](https://stackexchange.com/sites#science)
  * [ Professional ](https://stackexchange.com/sites#professional)
  * [ Business ](https://stackexchange.com/sites#business)
  * [ API ](https://api.stackexchange.com/)
  * [ Data ](https://data.stackexchange.com/)



  * [Blog](https://stackoverflow.blog?blb=1)
  * [Facebook](https://www.facebook.com/officialstackoverflow/)
  * [Twitter](https://twitter.com/stackoverflow)
  * [LinkedIn](https://linkedin.com/company/stack-overflow)
  * [Instagram](https://www.instagram.com/thestackoverflow)



Site design / logo © 2025 Stack Exchange Inc;  user contributions licensed under  [CC BY-SA](https://stackoverflow.com/help/licensing) .  rev 2025.3.17.23948


