The document proposes a privacy-preserving personalized web search framework called UPS. It aims to generalize user profiles for each query according to user-specified privacy requirements, while balancing personalization utility and privacy risk. Two algorithms, GreedyDP and GreedyIL, are developed to support runtime profile generalization. An online mechanism is also provided to decide whether personalizing a query would be beneficial without compromising privacy. Experiments show the effectiveness and efficiency of the UPS framework in achieving personalized search results while preserving user privacy.