Let G be a connected graph and S⊆V(G) with |S|≥2. A tree T in G is called an S-tree if S⊆V(T). Two S-trees T1 and T2 are internally disjoint if E(T1)∩E(T2)=0̸ and V(T1)∩V(T2)=S. For an integer k≥2, the generalizedk-connectivity of a graph G, denoted by κk(G), is defined as κk(G)=min{κG(S):S⊆V(G) and |S|=k}, where κG(S) denotes the maximum number of pairwise internally disjoint S-trees in G. The generalized connectivity is a generalization of traditional connectivity. Let Gn be the class of connected graphs of order n and let f(n,k,t)=minG∈Gn{|E(G)|:κk(G)=t}. In this paper, we prove f(n,k,t)≥⌈t(t+2)2t+2n⌉ for 4≤k≤n and 1≤t≤n−⌈k2⌉. In particular, the lower bound is sharp when k=4 and t=2 (i.e., we explicitly provide a family of graphs fulfilling the bound in this case), improving the known results of Sun et al. (2021).